Esempio n. 1
0
 private void Awake()
 {
     rpgCharacterController = GetComponent <RPGCharacterController>();
     //Find the Animator component.
     animator = GetComponentInChildren <Animator>();
     StartCoroutine(_HideAllWeapons(false, false));
 }
Esempio 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));
        }
        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));
        }
 void Update()
 {
     if (character != null)
     {
         RPGCharacterController controller = character.GetComponent <RPGCharacterController>();
         controller.SetJumpInput(Vector3.up);
         if (controller.CanStartAction("Jump"))
         {
             controller.StartAction("Jump");
         }
     }
 }
Esempio n. 6
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");
                }, () => { }));
            }
        }
        private void OnTriggerEnter(Collider collide)
        {
            RPGCharacterController controller = collide.gameObject.GetComponent <RPGCharacterController>();

            if (controller != null)
            {
                character = collide.gameObject;

                RPGCharacterMovementController movement = character.GetComponent <RPGCharacterMovementController>();
                oldJumpSpeed       = movement.jumpSpeed;
                movement.jumpSpeed = oldJumpSpeed * 2f;
                Debug.Log("Trampoline!");
            }
        }
 private void Awake()
 {
     //superCharacterController = GetComponent<SuperCharacterController>();
     rpgCharacterController      = GetComponent <RPGCharacterController>();
     rpgCharacterInputController = GetComponent <RPGCharacterInputController>();
     animator    = GetComponentInChildren <Animator>();
     capCollider = GetComponent <CapsuleCollider>();
     rb          = GetComponent <Rigidbody>();
     if (rb != null)
     {
         //Set restraints on startup if using Rigidbody.
         rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;
     }
     //Set currentState to idle on startup.
     currentState      = RPGCharacterState.Idle;
     rpgCharacterState = RPGCharacterState.Idle;
 }
Esempio n. 9
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));
 }
Esempio n. 10
0
 private void Awake()
 {
     rpgCharacterController         = GetComponent <RPGCharacterController>();
     rpgCharacterMovementController = GetComponent <RPGCharacterMovementController>();
     rpgCharacterWeaponController   = GetComponent <RPGCharacterWeaponController>();
 }
 private void Awake()
 {
     rpgCharacterController = GetComponent <RPGCharacterController>();
     rpgInputs  = new @RPGInputs();
     currentAim = Vector3.zero;
 }
Esempio n. 12
0
 private void Start()
 {
     // Get other RPG Character components.
     rpgCharacterController       = GetComponent <RPGCharacterController>();
     rpgCharacterWeaponController = GetComponent <RPGCharacterWeaponController>();
 }
Esempio n. 13
0
 void Awake()
 {
     rpgCharacterController = GetComponentInParent <RPGCharacterController>();
     animator = GetComponent <Animator>();
 }