private void Change(Collider target, bool targetValue) { if (target == null || !SmashGame.IsPlayer(target)) { return; } var character = target.GetComponentInParent <Character>(); character.IsGrounded = targetValue; }
protected void ChangeIgnore(Collider target, bool state) { if (target == null || !SmashGame.IsPlayer(target)) { return; } foreach (Collider col in _toIgnore) { Physics.IgnoreCollision(col, target, state); } }
private void Check(Collider col) { if (!SmashGame.IsPlayer(col)) { return; } var character = col.gameObject.GetComponentInParent <Character>(); if (character == null) { return; } if (character.InputSource.Crouch) { ChangeIgnore(col, true); } }
private void OnTriggerExit(Collider other) { // Filter only for player characters if (!SmashGame.IsPlayer(other)) { return; } Character characterScript = other.GetComponentInParent <Character>() ?? other.GetComponentInChildren <Character>(); if (characterScript == null) { Debug.Log("Was expecting" + other.name + " to be a Player, but no Character script was found."); return; } if (col.ClosestPointOnBounds(characterScript.position) == characterScript.position) { return; } characterScript.BlastZoneExit(); }