Exemplo n.º 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;
        }
    }
Exemplo n.º 2
0
    private void Awake()
    {
        playerController = GetComponent <PlayerController>();

        previousPlayerArmor = playerController.currentArmorStatus;

        FillDictionary();
    }