Line 14 has an error 1520 stating my Awake function needs a return type? No idea how to fix this.
using UnityEngine;
using System.Collections;
using System;
public class BaseCharacter : MonoBehaviour {
private string _name;
private int _level;
private uint _freeExp;
private Attribute[] _primaryAttribute;
private Vitals[] _vitals;
private Skills[] _skills;
public Awake()
{
_name = string.Empty;
_level = 0;
_freeExp = 0;
_primaryAttribute = new Attribute[Enum.GetValues(typeof(AttributeName)).Length];
_vitals = new Vitals[Enum.GetValues(typeof(VitalName)).Length];
_skills = new Skills[Enum.GetValues(typeof(SkillName)).Length];
SetupPrimaryAttributes();
SetupVitals();
SetupSkills();
}
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 < _vitals.Length; cnt+-)
{
_vitals[cnt] = new Vitals();
}
}
private void SetupSkills()
{
for(int cnt = 0; cnt < _skills.Length; cnt+-)
{
_skills[cnt] = new Skills();
}
}
public Attribute GetPrimaryAttributes(int index)
{
return _primaryAttribute[index];
}
public Vitals GetVitals(int index)
{
return _vitals[index];
}
public Skills GetSkills(int index)
{
return _skills[index];
}
private void SetupVitalModifiers()
{
//health
ModifyingAttribute health = new ModifyingAttribute ();
health.attribute = GetPrimaryAttributes ((int)AttributeName.Stamina);
health.ratio = .5f;
GetVitals ((int)VitalName.Health).AddModifier (health);
//power
ModifyingAttribute power = new ModifyingAttribute ();
power.attribute = GetPrimaryAttributes ((int)AttributeName.Intelligence);
power.ratio = .25f;
GetVitals ((int)VitalName.Power).AddModifier (power);
//armorclass
ModifyingAttribute armorclass = new ModifyingAttribute ();
armorclass.attribute = GetPrimaryAttributes ((int)AttributeName.Endurance);
armorclass.ratio = .5f;
}
private void SetupSkillModifiers()
{
ModifyingAttribute MeleeDamage = new ModifyingAttribute ();
ModifyingAttribute MeleeDefense = new ModifyingAttribute ();
ModifyingAttribute RangedDamage = new ModifyingAttribute ();
ModifyingAttribute RangedDefense = new ModifyingAttribute ();
ModifyingAttribute MagicDamage = new ModifyingAttribute ();
ModifyingAttribute MeagicDefense = new ModifyingAttribute ();
MeleeDamage.attribute = GetPrimaryAttributes ((int)AttributeName.Strength);
MeleeDamage.ratio = .33f;
RangedDamage.attribute = GetPrimaryAttributes ((int)AttributeName.Dexterity);
RangedDamage.ratio = .33f;
MagicDamage.attribute = GetPrimaryAttributes ((int)AttributeName.Intelligence);
MagicDamage.ratio = .33f;
MeleeDefense.attribute = GetPrimaryAttributes ((int)AttributeName.Endurance);
MeleeDefense.ratio = .33f;
RangedDefense.attribute = GetPrimaryAttributes ((int)AttributeName.Agility);
RangedDefense.ratio = .33f;
MagicDefense.attribute = GetPrimaryAttributes ((int)AttributeName.Wisdom);
MagicDefense.ratio = .33f;
GetSkills ((int)SkillName.Melee_Damage).AddModifier (MeleeDamage);
GetSkills ((int)SkillName.Melee_Defense).AddModifier (MeleeDefense);
GetSkills ((int)SkillName.Ranged_Damage).AddModifier (MeleeDamage);
GetSkills ((int)SkillName.Ranged_Defense).AddModifier (MeleeDefense);
GetSkills ((int)SkillName.Magic_Damage).AddModifier (MeleeDamage);
GetSkills ((int)SkillName.Magic_Defense).AddModifier (MeleeDefense);
}
public void StatUpdate()
{
for(int cnt = 0; cnt < _vitals.Length; cnt++)
_vitals[cnt].Update ();
for(int cnt = 0; cnt < _skills.Length; cnt++)
_skills[cnt].Update ();
}
}
ALSO, I have 3 errors for unexpected tokens ‘)’ on lines 57, 64 and 71