private bool IsAwoiding(PlatformCharacter2D player) { if (m_isCrate) { return(player.IsJumping()); } else { return(player.IsSliding()); } }
private void OnTriggerEnter2D(Collider2D collision) { PlatformCharacter2D player = collision.gameObject.GetComponent <PlatformCharacter2D>(); if (player && isworking) { if (!IsAwoiding(player)) { isworking = false; StartCoroutine(player.Fail()); } else { player.Yay(); } } }
private void Awake() { m_Character = GetComponent <PlatformCharacter2D>(); }