void FixedUpdate() { if ((timer += Time.deltaTime) < Timeout) { return; } if (!Colliding) { return; } //only trigger collision when player has actively moved if (InputManager.Instance.HasAction(InputManager.Actions.MoveForwards) || InputManager.Instance.HasAction(InputManager.Actions.MoveBackwards) || InputManager.Instance.HasAction(InputManager.Actions.MoveLeft) || InputManager.Instance.HasAction(InputManager.Actions.MoveRight)) //up/down//jump don't seem to trigger action in daggerfall { //start action thisAction.Receive(GameManager.Instance.PlayerObject, CollisionType); timer = 0; } Colliding = false; CollisionType = DaggerfallAction.TriggerTypes.None; }
//For Doors that are also action objects, executes action when door opened / closed private void ExecuteActionOnToggle() { DaggerfallAction action = GetComponent <DaggerfallAction>(); if (action != null) { action.Receive(gameObject, DaggerfallAction.TriggerTypes.Door); } }
void OnTriggerEnter(Collider col) { if (thisAction == null || isFlat) { return; } if (!thisAction.IsPlaying() && readyToPlayAgain) { readyToPlayAgain = false; thisAction.Receive(col.gameObject, false); } }
/// <summary> /// Triggers the next action in chain if any /// </summary> private void ActivateNext() { if (NextObject == null) { //DaggerfallUnity.LogMessage(string.Format("Next action object in chain is null")); return; } else { DaggerfallAction action = NextObject.GetComponent <DaggerfallAction>(); if (action != null) { action.Receive(this.gameObject, TriggerTypes.ActionObject); } } }
/// <summary> /// Triggers the next action in chain if any /// </summary> private void ActivateNext() { if (NextObject == null) { DaggerfallUnity.LogMessage(string.Format("Next object is null")); return; } else { DaggerfallAction action = NextObject.GetComponent <DaggerfallAction>(); if (action != null) { action.Receive(this.gameObject, false); } } }