public override void ExitAbility(GameObject player) { base.ExitAbility(player); abilityInput.HandleRange = 1f; if (collidedPlatform != null) { collidedPlatform.IsDamaging = false; } collidedPlatform = null; }
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; }
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>(); } }