unity3d - Unity is having trouble compiling a valid C# class -


i'm working on simple game right now, , unity , it's giving me strange error. have c# class called level has constructor takes 4 arguments:

using system;  namespace world {     public class level     {         public grid grid { get; private set; }         public int starty { get; private set; }         public int endy { get; private set; }          public level(int width, int height, int starty, int endy)         {             this.grid = new grid(width, height);             this.starty = starty;             this.endy = endy;         }     } } 

and class called worldgen still isn't of anything:

using system; using world;  namespace worldgen {     public class worldgen     {         public level generatelevel(int width, int height, int starty, int endy)         {             level level = new level(width, height, starty, endy); // line 47              grid grid = level.grid; // line 49              // ...              return level;         }     } } 

this straightforward me, (and generatelevel not called anywhere in project yet). calling csc in powershell compiles files in directory without errors or warnings.

but in unity window, i'm getting errors don't make sense me:

assets/worldgen/worldgen.cs(47:65): error cs1729: type 'level' not contain constructor takes '4' arguments assets/worldgen/worldgen.cs(49:31): error cs1061: type 'level' not contain definition ''grid' , no extension method 'grid' of type 'level' can found (are missing using directive of assembly reference?)

it's worldgen has access class level can't see of public methods.

it seems me unity wrong code, experience that's case. don't know wants me. level in project directory. it's constructor takes 4 arguments, i'm passing types needs, , has public grid field. gets me know code compiles on own when unity taken out of picture.

i don't know i'm missing, , wondering if out there give me clue.

i'd have naming conflict level. try specifying namespace explicitly:

world.level level = new world.level(width, height, starty, endy);


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -