private void OnTriggerExit(Collider collide) { if (collide.gameObject == controller.gameObject) { controller.SetHandler("Jump", oldJumpHandler); controller = null; oldJumpHandler = null; } }
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)); }
void Update() { if (character != null) { RPGCharacterController controller = character.GetComponent <RPGCharacterController>(); controller.SetJumpInput(Vector3.up); if (controller.CanStartAction("Jump")) { controller.StartAction("Jump"); } } }
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)); }
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() { rpgCharacterController = GetComponent <RPGCharacterController>(); currentAim = Vector3.zero; }
void Awake() { rpgCharacterController = GetComponentInParent <RPGCharacterController>(); animator = GetComponent <Animator>(); }
private void Start() { // Get other RPG Character components. rpgCharacterController = GetComponent <RPGCharacterController>(); rpgCharacterWeaponController = GetComponent <RPGCharacterWeaponController>(); }