Beispiel #1
0
        public override void ProcessNode()
        {
            UIStack.Instance.ExitStack(true);
            //传送到目标地址
            Vector3 from_pos = new Vector3(25.0f, 0.0f, 45.0f);
            Vector3 to_pos   = new Vector3(0.0f, 0.0f, 0.0f);//0,0,0 目标场景会自动设置为初始位置

            SceneLogic.Transfer(scene, from_pos, 90.0f, transfer_scene, to_pos, 90.0f);
        }
Beispiel #2
0
        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);
        }