예제 #1
0
        private void Change(Collider target, bool targetValue)
        {
            if (target == null || !SmashGame.IsPlayer(target))
            {
                return;
            }

            var character = target.GetComponentInParent <Character>();

            character.IsGrounded = targetValue;
        }
예제 #2
0
        protected void ChangeIgnore(Collider target, bool state)
        {
            if (target == null || !SmashGame.IsPlayer(target))
            {
                return;
            }

            foreach (Collider col in _toIgnore)
            {
                Physics.IgnoreCollision(col, target, state);
            }
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
        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();
        }