//For awake to work the first 4 children must be the character frame, then the voice and sound effect sources, // Then the Bars void Awake() { //Find objects //Debug.Log("Awake"); aI = GetComponentInChildren <AI>(); changeLocation = GetComponentInChildren <ChangeLocationScript>(); animator = transform.GetChild(0).GetComponent <Animator>(); attackAnimator = GetComponent <Animator>(); voiceEffects = transform.GetChild(1).GetComponent <AudioPuller>(); soundEffects = transform.GetChild(2).GetComponent <AudioPuller>(); mover = transform.GetChild(0).GetComponent <Movement>(); Transform barWrapper = transform.GetChild(3).GetChild(0); actionBar = barWrapper.GetChild(0).GetChild(0).GetComponent <LowerFilling>(); hpBar = barWrapper.GetChild(1).GetChild(0).GetComponent <LowerFilling>(); allCharacters.Add(this); activeBuffs = new List <Buff>(); loadedAttacks = new List <Attack>(); }
void Start() { changeLoc = GetComponent <ChangeLocationScript>(); mainAnimator = GetComponent <Animator>(); sideAnimator = transform.parent.GetComponent <Animator>(); }
void Awake() { toFollow = transform.parent.GetChild(0).GetComponent <ChangeLocationScript>(); }