Exemple #1
0
    public override void ExitAbility(GameObject player)
    {
        base.ExitAbility(player);

        abilityInput.HandleRange = 1f;

        if (collidedPlatform != null)
        {
            collidedPlatform.IsDamaging = false;
        }

        collidedPlatform = null;
    }
Exemple #2
0
    public override void InitAbility(GameObject player)
    {
        base.InitAbility(player);

        abilityInput.HandleRange = 0f;
        playerColor = player.GetComponent <PlayerColor>();
        playerInfo  = player.GetComponent <PlayerInfo>();

        collidedPlatform = null;

        EventManager.instance.setPlatformEvent -= SetPlatform;
        EventManager.instance.setPlatformEvent += SetPlatform;
    }
Exemple #3
0
    private void SetPlatform(GameObject platform, COLORS platformColor)
    {
        if (platformColor != mainColor)
        {
            return;
        }

        if (platform == null)
        {
            if (collidedPlatform != null)
            {
                collidedPlatform.IsDamaging = false;
            }

            collidedPlatform = null;
            return;
        }

        if (platform.GetComponent <DamagingPlatform>() != null)
        {
            collidedPlatform = platform.GetComponent <DamagingPlatform>();
        }
    }