Hi Guys Ok. This may Seems little Noobish. but when i Fix 1 Minor Error. It make 47 Errors More!
I am New at Forums so Please If i do something Noobish Wrong. Don’t get mad at me
Just Please don’t Push me like i am a noob. It has been Repeated 10 Times so Please!
I Beg you For Helping Me Ok so Here are the Scripts:
using UnityEngine;
using System.Collections;
using System;
public class BaseCharacter : MonoBehaviour {
private string _name;
private int _level;
private uint _freeExp;
private Attribute[] _primaryAttribute;
private Vital[] _vital;
private Skill[] _skill;
public void Awake () {
_name = String.Empty;
_level = 0;
_freeExp = 0;
_primaryAttribute = new Attribute[Enum.GetValues(typeof(AttributeName)).Length];
_vital = new Attribute[Enum.GetValues(typeof(VitalName)).Length];
_skill = new Attribute[Enum.GetValues(typeof(SkillName)).Length];
SetupPrimaryAttributes();
SetupVitals();
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 FreeExp {
get{ return _freeExp; }
set { _freeExp = value; }
}
public void AddExp (uint exp){
_freeExp += exp;
CalculateLevel();
}
public void CalculateLevel() {
}
private void SetupPrimaryAttributes() {
for(int cnt = 0; cnt < _primaryAttribute.Length; cnt++) {
_primaryAttribute[cnt] = new Attribute();
}
}
private void SetupVitals() {
for(int cnt = 0; cnt < _vital.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.Health).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Vitality), .5f));
//Energy
GetVital((int)VitalName.Energy).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Stamina), .5f));
//Mana
GetVital((int)VitalName.Mana).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Intelligent), .5f));
}
private void SetupSkillModifiers() {
//melee offence
GetSkill((int)SkillName.Melee_Offence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Power), .33f));
//melee defence
GetSkill((int)SkillName.Melee_Defence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Defence), .33f));
//magic offence
GetSkill((int)SkillName.Magic_Offence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Intelligent), .33f));
//magic defence
GetSkill((int)SkillName.Magic_Defence).AddModifier(new ModifyingAttribute(GetPrimaryAttribute((int)AttributeName.Intelligent), .33f));
//Ranged Offence
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();
}
}
Error:
Before i Place “void” Before Awake: Assets/Scripts/Character Classes/BaseCharacter.cs(14,16): errorCS1520: Class, struct, or interface method must have a return type
After:
To much. Needs a Picture: