예제 #1
0
    // 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;
        }
    }
예제 #2
0
    private void Awake()
    {
        playerController = GetComponent <PlayerController>();

        previousPlayerArmor = playerController.currentArmorStatus;

        FillDictionary();
    }