Пример #1
0
        public void SendMessage(SceneBase owner, Dictionary <string, object> param)
        {
            SceneNode ownerSceneNode = _sceneNodeSet.nodeList.FirstOrDefault(x => x.scene == owner);

            if (ownerSceneNode == null)
            {
                return;
            }

            Scene     currentScene     = (Scene)Enum.Parse(typeof(Scene), ownerSceneNode.name);
            SceneBase currentSceneBase = _sceneNodeSet.currentSceneNode.scene;

            if (currentSceneBase.Equals(owner) == false)
            {
                currentSceneBase.OnSceneMessage(currentScene, param);
            }

            foreach (var subSceneProperty in _sceneNodeSet.currentSceneNode.property.listAddSubScene)
            {
                SceneNode subSceneNode = _sceneNodeSet.Find(subSceneProperty.sceneName);
                if (subSceneNode.scene.Equals(owner) == false)
                {
                    subSceneNode.scene.OnSceneMessage(currentScene, param);
                }
            }
        }
Пример #2
0
        public void ChangeSubSceneSlide(SceneBase owner, string beforeSceneName, string afterSceneName, SlideType slideType)
        {
            if (IsSceneLoading() == true)
            {
                throw new Exception(string.Format("{0}.{1} Loading...", typeof(SceneManager).Name, MethodBase.GetCurrentMethod().Name));
            }
            if (IsSubSceneChanging() == true)
            {
                throw new Exception(string.Format("{0}.{1} SubScene Changing...", typeof(SceneManager).Name, MethodBase.GetCurrentMethod().Name));
            }
            if (_sceneNodeSet.currentSceneNode.scene.Equals(owner) == false)
            {
                throw new Exception(string.Format("{0}.{1} Please call from the main scene.", typeof(SceneManager).Name, MethodBase.GetCurrentMethod().Name));
            }
            if (string.IsNullOrEmpty(beforeSceneName) == true && string.IsNullOrEmpty(afterSceneName) == true)
            {
                throw new Exception(string.Format("{0}.{1} Param All Empty...", typeof(SceneManager).Name, MethodBase.GetCurrentMethod().Name));
            }
            if (string.IsNullOrEmpty(beforeSceneName) == false && _sceneNodeSet.IsCurrentSubSceneContains(beforeSceneName) == false)
            {
                throw new Exception(string.Format("{0}.{1} beforeSceneName:{3} NotFound in SubSceneList...", typeof(SceneManager).Name, MethodBase.GetCurrentMethod().Name, beforeSceneName));
            }
            if (string.IsNullOrEmpty(afterSceneName) == false && _sceneNodeSet.IsCurrentSubSceneContains(afterSceneName) == false)
            {
                throw new Exception(string.Format("{0}.{1} afterSceneName: {3} NotFound in SubSceneList...", typeof(SceneManager).Name, MethodBase.GetCurrentMethod().Name, afterSceneName));
            }

            _changeSubSceneProcess = CreateChangeSubSceneSlideProcess(beforeSceneName, afterSceneName, slideType);
        }
Пример #3
0
 public void ChangeSubSceneSlide(SceneBase owner, Scene beforeScene, Scene afterScene, SlideType slideType)
 {
     ChangeSubSceneSlide(owner,
                         beforeScene == Scene.Empty ? null : beforeScene.ToString(),
                         afterScene == Scene.Empty ? null : afterScene.ToString(),
                         slideType
                         );
 }
Пример #4
0
        public SceneNode(string name, GameObject rootObject, SceneType sceneType)
        {
            this.name          = name;
            this.rootObject    = rootObject;
            this.sceneType     = sceneType;
            this.state         = SceneState.Empty;
            this.isInitialized = false;
            this.isVisibled    = true;

            this._scene    = scene;
            this._property = property;
        }
Пример #5
0
        public T GetSubScene <T> (SceneBase owner) where T : SceneBase
        {
            if (_sceneNodeSet.currentSceneNode.scene.Equals(owner) == false)
            {
                return(null);
            }

            foreach (var subSceneProperty in _sceneNodeSet.currentSceneNode.property.listAddSubScene)
            {
                SceneNode sceneNode = _sceneNodeSet.Find(subSceneProperty.sceneName);
                if (sceneNode != null && sceneNode.scene is T)
                {
                    return(sceneNode.scene as T);
                }
            }

            return(null);
        }
Пример #6
0
 public bool IsCurrentScene(SceneBase owner)
 {
     return(_sceneNodeSet.currentSceneNode.scene.Equals(owner));
 }