/// <summary> /// Check if is on top of the lean platform. /// </summary> /// <param name="player"></param> /// <returns> /// true: is on top of the box. /// false: vice versa. /// </returns> public virtual bool IsOpTopOfLeanPlatform(JCS_Player player) { if (mPositionPlatform == null || player == null) { return(false); } bool isTopOfBox = JCS_Physics.TopOfBox( player.GetCharacterController(), mPositionPlatform.GetPlatformCollider()); return(isTopOfBox); }
/// <summary> /// Ignore physics to all the active player except /// the active player. /// </summary> /// <param name="cc"> Collider want to ignore with. </param> public void IgnorePhysicsToAllExceptActivePlayer(Collider cc) { // ignore all IgnorePhysicsToAllPlayer(cc); if (mActivePlayer == null) { return; } // active Physics.IgnoreCollision( mActivePlayer.GetCharacterController(), cc, true); }
protected virtual void OnTriggerExit(Collider other) { JCS_Player player = JCS_GameManager.instance.GetJCSPlayer(); if (player == null) { return; } if (other.gameObject.name == player.name) { Physics.IgnoreCollision(mPlatformCollider, player.GetCharacterController(), false); } }