Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Chocopop · Jan 04, 2014 at 11:55 PM · c#enumreturn type

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,
 }
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Jan 05, 2014 at 12:27 AM 1
Share

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.

  • Read this page : http://answers.unity3d.com/page/newuser.html

  • Watch : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers

avatar image AlucardJay · Jan 05, 2014 at 12:28 AM 1
Share

It looks like your doing the Burgzerg Arcade tutorial. Just watch the videos carefully, chances are that you have made a mistake.

avatar image NikoBusiness · Jan 06, 2014 at 08:59 AM 0
Share

Ranged_Offence, Range_Defence why not Ranged_defence?

avatar image HappyMoo · Jan 06, 2014 at 02:09 PM 0
Share

You need help titling your questions. Seriously... Please go back and edit the titles to all your questions.

2 Replies

· Add your reply
  • Sort: 
avatar image
3

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()

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

can't get this right... help please... 1 Answer

Expression denotes a `method group', where a `variable', `value' or `type' was expected 1 Answer

Use a enum from another script 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges