- Home /
Strange inheritance problem
Hi Gang,
I bumped into a weird problem..
I created a new script with the name (and public class name of course) of "EnemyUnitController" , and I wanted it to inherit from another base class which also inherits from MonoBehavior.
For some reason, I couldn't inherit it and Visual studio complained with the following error: Partial declarations of 'EnemyUnitController' must not specify different base classes
The solution was a surprise: I took all the code inside that class, put it in another script (named either 'test' or 'BasicEnemyUnitController') and that did the magic.
I tried to find a reference for EnemyUnitController on google to see if its a saved word or class name in unity, but couldn't find anything...
What do you think?
$$anonymous$$aybe you imported some 3rd party assets that contains a class named that way. In Visual Studio you have the Class View panel, where you can Search for that class.
Your answer
Follow this Question
Related Questions
An OS design issue: File types associated with their appropriate programs 1 Answer
Attach a non Monobehavior class to a GameObject 1 Answer
Is it possible to change value on base class when the same field gets changed on it's derived class 0 Answers
How to prevent an inherited variable from showing up on a scriptable object? 1 Answer