public override bool ProcessTriggerEnter(string locator, GameObject trigger) { TriggerEntry target = null; for (int i = 0; i < m_Triggers.Count; i++) { if (m_Triggers[i].locator.Equals(locator)) { target = m_Triggers[i]; DialogueTriggerEntry dte = target as DialogueTriggerEntry; PlayerManager.LocalPlayerController().TargetingComponent.SetMovementTarget(Vector3.zero, true); AttackTarget = PlayerManager.LocalPlayerController().TargetingComponent.AttackTarget; PlayerManager.LocalPlayerController().TargetingComponent.AttackTarget = null; PlayerController.LocalPlayerDisableNavigation(); DialoguePlayUtil.Instance.Play(dte.id, DialogueOver); break; } } if (target != null) { m_Triggers.Remove(target); return(true); } return(false); }
public override bool ProcessTriggerEnter(string locator, GameObject trigger) { TriggerEntry target = null; if (m_Triggers == null) { EB.Debug.LogWarning("TransferTriggerProcessor.ProcessTriggerEnter: m_Triggers = null!"); return(false); } for (int i = 0; i < m_Triggers.Count; i++) { if (m_Triggers[i].locator.Equals(locator)) { //防止重入,重入会导致场景多次加载 if (SceneLogic.SceneState != SceneLogic.eSceneState.SceneLoop || IsTransfering) { return(true); } IsTransfering = true; target = m_Triggers[i]; TransferTriggerEntry tte = target as TransferTriggerEntry; PlayerManager.LocalPlayerController().TargetingComponent.SetMovementTarget(Vector3.zero, true); //PlayerController.LocalPlayerDisableNavigation(); UIStack.Instance.ExitStack(); EB.Debug.Log("Transfer!!!"); Vector3 from_pos = new Vector3(25.0f, 0.0f, 45.0f); SceneLogic.Transfer("mapview", from_pos, 90.0f, tte.name, tte.pos, 90.0f, delegate(bool sucessful) { if (!sucessful) { IsTransfering = false; } }); return(true); } } return(false); }