Beispiel #1
0
 private void Awake()
 {
     rpgCharacterController = GetComponent <RPGCharacterController>();
     rpgCharacterController.SetHandler("AcquiringGround", new Actions.SimpleActionHandler(() => { }, () => { }));
     rpgCharacterController.SetHandler("MaintainingGround", new Actions.SimpleActionHandler(() => { }, () => { }));
     rpgCharacterController.SetHandler("DiveRoll", new Actions.DiveRoll(this));
     rpgCharacterController.SetHandler("Fall", new Actions.Fall(this));
     rpgCharacterController.SetHandler("GetHit", new Actions.GetHit(this));
     rpgCharacterController.SetHandler("Idle", new Actions.Idle(this));
     rpgCharacterController.SetHandler("Jump", new Actions.Jump(this));
     rpgCharacterController.SetHandler("Knockback", new Actions.Knockback(this));
     rpgCharacterController.SetHandler("Move", new Actions.Move(this));
 }
Beispiel #2
0
 private void OnTriggerExit(Collider collide)
 {
     if (collide.gameObject == controller.gameObject)
     {
         controller.SetHandler("Jump", oldJumpHandler);
         controller     = null;
         oldJumpHandler = null;
     }
 }
Beispiel #3
0
        private void Awake()
        {
            coroQueue = new CoroutineQueue(1, StartCoroutine);
            rpgCharacterController = GetComponent <RPGCharacterController>();
            rpgCharacterController.SetHandler("SwitchWeapon", new Actions.SwitchWeapon());

            // Find the Animator component.
            animator = GetComponentInChildren <Animator>();
            StartCoroutine(_HideAllWeapons(false, false));
        }
        void Awake()
        {
            // In order for the navMeshAgent not to interfere with other movement, we want it to be
            // enabled ONLY when we are actually using it.
            navMeshAgent         = GetComponent <UnityEngine.AI.NavMeshAgent>();
            navMeshAgent.enabled = false;

            rpgCharacterController         = GetComponent <RPGCharacterController>();
            rpgCharacterMovementController = GetComponent <RPGCharacterMovementController>();
            rpgCharacterController.SetHandler("Navigation", new Actions.Navigation(this));
        }
Beispiel #5
0
        private void OnTriggerEnter(Collider collide)
        {
            controller = collide.gameObject.GetComponent <RPGCharacterController>();

            if (controller != null)
            {
                oldJumpHandler = controller.GetHandler("Jump");
                controller.SetHandler("Jump", new SimpleActionHandler(() => {
                    Debug.Log("Can't jump!");
                    controller.EndAction("Jump");
                }, () => { }));
            }
        }