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 Kitanona · Jan 05, 2014 at 06:09 AM · console errors

Why do I keep getting this error?

I keep getting this error and I can't find the problem I don't know if I worded something wrong or I am missing a typo, but I can't get it to go away no matter what I do

Assets/chcarcterClasses/BaseCharacter.cs(101,64): error CS0246: The type or namespace name `ModifyingAttribute' could not be found. Are you missing a using directive or an assembly reference?

using UnityEngine; using System.Collections; using System; //acces the enum class

public class BaseCharacter : MonoBehaviour {

 private string _name;
 private int _level;
 private uint _freeEx;
 
 private Attribute[]_primaryAttribute;
 private vital[]_vital;
 private skill[]_skill;
   
 public void Awake(){
 
 _name = string.Empty;
     _level =0;
     _freeEx =0;
     
     _primaryAttribute = new Attribute[Enum.GetValues(typeof(AttributeName)).Length];
 
     _vital = new vital[Enum.GetValues(typeof(VitalName)).Length];
     
     _skill = new skill[Enum.GetValues(typeof(SkillName)).Length];
     
     SetUpPrimaryAttribute();
     SetUpVital();
     SetUpSkills();
     
 }
 
 
 // Use this for initialization
 void Start () {
 
 }
 
 // Update is called once per frame
 void Update () {
 
 }
 
 public string Name {
     get{ return _name;}
     set{ _name = value; }
 }
 
 public int Level {
     get{ return _level;}
     set{ _level= value;}
 }
 
 public uint FreeEx{
     get{ return _freeEx;}
     set{ _freeEx = value;}
         
     }
     
 public void AddEx(uint ex){
         _freeEx += ex;
             CalculateLevel();
     }
 
 //take advantage  of the players skills and assign them to a level
     public void CalculateLevel(){
     
     }
     
 private void SetUpPrimaryAttribute(){
     for(int cnt = 0; cnt < _primaryAttribute.Length; cnt++){
         _primaryAttribute[cnt] = new Attribute();
 }
             }
 
 private void SetUpVital(){
         for( int cnt = 0; cnt <_skill.Length; cnt++){
                 _vital[cnt]= new vital();
             }
             
 }
 
 private void SetUpSkills(){
             for(int cnt = 0; cnt < _skill.Length; cnt++){
                 _skill[cnt] = new skill();
             }
 }
 
 public Attribute GetPrimaryAttribute(int index){
     return _primaryAttribute[index];
 }
 public vital GetVital(int index){
     return _vital[index];
 }
 public skill GetSkill(int index){
     return _skill[index];
 }
 
 private void SetUpVitalModifiers(){
     //Health
     GetVital((int)VitalName.Healh).AddModifier(new ModifyingAttribute()(GetPrimaryAttribute((int)AttributeName.Constitution), .5f));
     //energy
     GetVital((int)VitalName.Energy).AddModifier(new ModifyingAttribute()(GetPrimaryAttribute((int)AttributeName.Constitution), 1));
     
     // mana
     GetVital((int)VitalName.Mana).AddModifier(new ModifyingAttribute()(GetPrimaryAttribute((int)AttributeName.Willpower),1));
     
     
 }
 private void SetUpSkillModifiers()
 {
 //melee offence
         GetSkill((int)SkillName.Magic_Offence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Might),.33f));
         GetSkill((int)SkillName.Magic_Offence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.NImbelness),.33f));
 //melee defence
         GetSkill((int)SkillName.Melee_Defence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Speed),.33f));
         GetSkill((int)SkillName.Magic_Defence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Constitution),.33f));
 //magic offence
         GetSkill((int)SkillName.Magic_Offence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Constitution),.33f));
         GetSkill((int)SkillName.Magic_Offence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Willpower),.33f));
 //magic defence
         GetSkill((int)SkillName.Magic_Defence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Concentration),.33f));
         GetSkill((int)SkillName.Magic_Defence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Concentration),.33f));
 //ranged offence
         GetSkill((int)SkillName.Ranged_Offence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Concentration),.33f));
         GetSkill((int)SkillName.Ranged_Offence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Speed),.33f));
 //ranged defence
         GetSkill((int)SkillName.Ranged_Defence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Speed),.33f));
         
         }
 public void StatUpdate(){
 for(int cnt =0; cnt <_vital.Length; cnt++)
         _vital[cnt].Update();
     for(int cnt = 0; cnt < _skill.Length; cnt++)
         _skill[cnt].Update();
 }

}

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 Benproductions1 · Jan 05, 2014 at 06:40 AM 0
Share

Please format your code. If you don't know how, watch the tutorial video on the right

avatar image Kitanona · Jan 05, 2014 at 09:03 AM -1
Share

I was following a tutorial and that was the script that I ended up with..... I don't understand why its a problem... Unless they made changes in the scripting language from unity 3 to unity 4

avatar image Benproductions1 Kitanona · Jan 05, 2014 at 09:03 AM 0
Share

Please post comments as comments NOT as answers

avatar image Benproductions1 · Jan 05, 2014 at 09:05 AM 0
Share

Please follow as instructed and format your code. I can probably answer your question, but until you format your code I'm just not going to read it

0 Replies

· Add your reply
  • Sort: 

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

19 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

Related Questions

Do you need Unity Pro to sell to the asset store or am I just glitching? 0 Answers

Redirect Unity unmanaged console 0 Answers

'Red' Errors in Console and Production of Garbage in Memory. 0 Answers

get component screws with the game. 2 Answers

The console no longer takes you directly to the error in the script? 1 Answer


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