protected virtual void Awake() { var animator = GetComponent <Animator>(); var renderer = GetComponent <CharacterRenderer>(); attackAnimation = new ActionAnimation(animator, renderer, "Attack", 0.5f); soundPlayer = GetComponentInChildren <CharacterSoundsPlayer>(); }
public void Awake() { rigidBody = GetComponent <Rigidbody2D>(); renderer = GetComponentInChildren <CharacterRenderer>(); attack = GetComponent <Attack>(); dying = GetComponent <Dying>(); soundPlayer = GetComponentInChildren <CharacterSoundsPlayer>(); }
// Start is called before the first frame update void Awake() { Dead = InitiallyDead; var animator = GetComponent <Animator>(); renderer = GetComponent <CharacterRenderer>(); selection = GetComponent <UnitSelection>(); dyingAnimation = new ActionAnimation(animator, renderer, "Dying", 0.5f); soundPlayer = GetComponentInChildren <CharacterSoundsPlayer>(); movement = GetComponent <CharacterMovement>(); switchOffAbleComponents = new ComponentsSet(this, "Attack", "CharacterMovement", "ClickCatching", "UnitSelection", "Navigator"); }