private void SetGroundDetection()
        {
            if (groundDetection != GroundDetection.Collision)
            {
                groundCastTimer = new Countdown(groundCastFrequency);
            }

            switch (groundDetection)
            {
            case GroundDetection.Raycast:
                break;

            case GroundDetection.CheckSphere:
                sphereOffset = Vector3.up * (groundCollider.radius * 0.9f);
                break;

            case GroundDetection.Collision:
                if (groundCollider.isTrigger)
                {
                    collisionProxy = StratusCollisionProxy.Construct(groundCollider, StratusCollisionProxy.CollisionMessage.TriggerEnter, OnCollider);
                }
                else
                {
                    collisionProxy = StratusCollisionProxy.Construct(groundCollider, StratusCollisionProxy.CollisionMessage.CollisionEnter, OnCollision);
                }
                break;
            }

            switch (locomotion)
            {
            case LocomotionMode.Velocity:
            case LocomotionMode.Force:
                break;

            case LocomotionMode.CharacterController:
                characterController.Move(-Vector3.up);
                break;

            case LocomotionMode.NavMeshAgent:
                break;
            }
        }
Exemplo n.º 2
0
 //--------------------------------------------------------------------------------------------/
 // Messages
 //--------------------------------------------------------------------------------------------/
 protected override void OnAwake()
 {
     proxy = StratusCollisionProxy.Construct(source, type, OnTrigger, OnCollision, persistent);
 }