private void Awake()
        {
            coroQueue = new CoroutineQueue(1, StartCoroutine);
            rpgCharacterController = GetComponent <RPGCharacterController>();
            rpgCharacterController.SetHandler("SwitchWeapon", new Actions.SwitchWeapon());
            rpgCharacterController.SetHandler("Relax", new Actions.Relax());

            // Find the Animator component.
            animator = GetComponentInChildren <Animator>();

            StartCoroutine(_HideAllWeapons(false, false));
        }
Ejemplo n.º 2
0
 private void OnTriggerExit(Collider collide)
 {
     if (collide.gameObject == controller.gameObject)
     {
         controller.SetHandler("Jump", oldJumpHandler);
         controller     = null;
         oldJumpHandler = null;
     }
 }
        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));
        }
Ejemplo n.º 4
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");
                }, () => { }));
            }
        }
Ejemplo n.º 5
0
 private void Awake()
 {
     rpgCharacterController = GetComponent <RPGCharacterController>();
     rpgCharacterController.SetHandler("AcquiringGround", new Actions.SimpleActionHandler(() => { }, () => { }));
     rpgCharacterController.SetHandler("MaintainingGround", new Actions.SimpleActionHandler(() => { }, () => { }));
     rpgCharacterController.SetHandler("ClimbLadder", new Actions.ClimbLadder(this));
     rpgCharacterController.SetHandler("DiveRoll", new Actions.DiveRoll(this));
     rpgCharacterController.SetHandler("DoubleJump", new Actions.DoubleJump(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("Knockdown", new Actions.Knockdown(this));
     rpgCharacterController.SetHandler("Move", new Actions.Move(this));
     rpgCharacterController.SetHandler("Roll", new Actions.Roll(this));
     rpgCharacterController.SetHandler("Swim", new Actions.Swim(this));
 }