// listens to a layer change private void ListenToCurrentLayerChange() { // change animation layer depending on player armor status if (previousPlayerArmor != playerController.currentArmorStatus) { switch (playerController.currentArmorStatus) { case PlayerController.PlayerArmor.Armored: currentLayer = AnimationLayer.Armored; break; case PlayerController.PlayerArmor.Naked: currentLayer = AnimationLayer.Naked; break; default: break; } previousPlayerArmor = playerController.currentArmorStatus; } if (currentLayer != previousLayer) { ChangeAnimatorLayer(currentLayer); previousLayer = currentLayer; } }
private void Awake() { playerController = GetComponent <PlayerController>(); previousPlayerArmor = playerController.currentArmorStatus; FillDictionary(); }