- Home /
member names cannot be the same as their enclosing type
it sais that: ¨member names cannot be the same as their enclosing type¨
public class Skill : ModifiedStat {
private bool _known;
public void Skill() {
_known= false;
ExpToLevel = 25;
LevelModifier = 1.1f;
}
public bool Known {
get{ return _known; }
set{ _known = value; }
}
}
public enum SkillName {
Melee_Offence,
Melee_Defence,
Ranged_Offence,
Range_Defence,
Magic_Offence,
Magic_Defence,
}
Please make your titles more descriptive to the problem you're having. Bunny stated this on your other question.
And as I (and tanoshimi) posted on others of your questions :
please format your code. You can do this by highlighting all your code, then clicking the 10101 button at the top of the edit window.
It looks like your doing the Burgzerg Arcade tutorial. Just watch the videos carefully, chances are that you have made a mistake.
Ranged_Offence, Range_Defence why not Ranged_defence?
You need help titling your questions. Seriously... Please go back and edit the titles to all your questions.
Answer by Tak · Jan 06, 2014 at 04:00 PM
You're declaring a method instead of a constructor:
public void Skill()
should be
public Skill()
Answer by Anderson_best · Sep 11, 2017 at 09:24 PM
The name of the class "Skill" and the name of the "Skill()" function must not match!
Your answer
![](https://koobas.hobune.stream/wayback/20220613125553im_/https://answers.unity.com/themes/thub/images/avi.jpg)