コード例 #1
0
ファイル: FadeOut.cs プロジェクト: hirama-akihiro/MazeEscaper
        /// <summary>
        /// フェードアウト管理クラス
        /// </summary>
        /// <param name="conent"></param>
        /// <param name="graphicsDevice"></param>
        public FadeOut(ContentManager content,GraphicsDevice graphicsDevice,SceneType scenetype)
        {
            this.content = content;
            this.graphicsDevice = graphicsDevice;

            LoadContent();

            this.scenetype = scenetype;

            //フェードアウトの初期化
            m_alpha = 0.0f;

            switch (scenetype)
            {
                case SceneType.InGame:
                    m_alphaIncAmout = 0.02f;
                    break;
                case SceneType.OutGame:
                    m_alphaIncAmout = 0.04f;
                    break;
            }

            //フェードアウト描画サイズ
            screenBound = new Rectangle(0, 0, GameMain.ScreenWidth, GameMain.ScreenHeight);
            //黒色でフェードアウト
            color = new Color(0.0f, 0.0f, 0.0f, m_alpha);
            EndFadeOut = false;
        }
コード例 #2
0
    public void SwitchScene(SceneType sceneType , params object[] sceneArgs)
    {
        string name = sceneType.ToString();
        //GameObject scene = ResourceMgr.GetInstance().CreateGameObject("Game/UI/"+name, false);
        GameObject scene = new GameObject(name);
        SceneBase baseObj = scene.AddComponent(Type.GetType(name)) as SceneBase;
        //baseObj.Init(sceneArgs);
        baseObj.OnInit(sceneArgs);
        if (parentObj == null)
        {
            parentObj = GameObject.Find("UI Root").transform;
        }
        scene.transform.parent = parentObj;
        scene.transform.parent.localEulerAngles = Vector3.zero;
        scene.transform.localScale = Vector3.one;
        scene.transform.localPosition = Vector3.zero;
        LayerMgr.GetInstance().SetLayer(baseObj.gameObject, LayerType.Scene);
        if (name.Equals(mainSceneName))
        {//如果进入主场景,则清空记录
            switchRecorder.Clear();
        }

        switchRecorder.Add(new SwitchRecorder(sceneType, sceneArgs));
        if (curren != null)
        {
            GameObject.Destroy(curren);
        }
        curren = scene;
    }
コード例 #3
0
ファイル: SceneManagerScript.cs プロジェクト: jwvg0425/Hmmo
 public void SceneChange(SceneType type)
 {
     UserScript user = GameObject.FindGameObjectWithTag("Network").GetComponent<UserScript>();
     string sceneName = "";
     switch (type)
     {
         case SceneType.GAME:
             sceneName = "GameScene";
             user.State = UserState.GAME;
             break;
         case SceneType.TITLE:
             sceneName = "TitleScene";
             user.State = UserState.START;
             break;
         case SceneType.LOBBY:
             sceneName = "LobbyScene";
             user.State = UserState.LOBBY;
             break;
         case SceneType.PICK:
             sceneName = "PickScene";
             user.State = UserState.PICK;
             break;
         default:
             break;
     }
     Application.LoadLevel(sceneName);
 }
コード例 #4
0
    public static void SwitchToScene(SceneType sceneType)
    {
        FStage oldScene = null;

        oldScene = currentScene;

        if (sceneType == SceneType.MergeNamesScene) currentScene = new TMergeNamesScene();
        else if (sceneType == SceneType.ClickHeartsScene) currentScene = new TClickHeartsScene();
        else if (sceneType == SceneType.PeopleSceneGoalOne) {
            currentScene = new TPeopleScene(GoalType.GoalOne);
            goalOneTutorialIsDone = true;
        }
        else if (sceneType == SceneType.PeopleSceneGoalTwo) currentScene = new TPeopleScene(GoalType.GoalTwo);
        else if (sceneType == SceneType.PeopleSceneGoalThree) currentScene = new TPeopleScene(GoalType.GoalThree);
        else if (sceneType == SceneType.DreamSceneOne) currentScene = new TDreamScene(DreamSceneType.DreamSceneOne);
        else if (sceneType == SceneType.DreamSceneTwo) currentScene = new TDreamScene(DreamSceneType.DreamSceneTwo);

        if (oldScene != null) {
            currentScene.alpha = 0;
            Go.to(oldScene, 0.3f, new TweenConfig().floatProp("alpha", 0.0f).onComplete(OnOldSceneCompletedFadingOut));
            Go.to(currentScene, 0.3f, new TweenConfig().floatProp("alpha", 1.0f));
        }

        Futile.AddStage(currentScene);
        Futile.AddStage(labelDisplayLayer); // move to top
    }
コード例 #5
0
ファイル: SSSceneManager.cs プロジェクト: unchi/SSSystem
 public SceneData(string sn, object dt, SSCallBackDelegate onActive, SSCallBackDelegate onDeactive, SceneType type)
 {
     SceneName = sn;
     Data = dt;
     Type = type;
     OnActive = onActive;
     OnDeactive = onDeactive;
 }
コード例 #6
0
ファイル: SceneManager.cs プロジェクト: Nyxzzz/ssmini
 public SceneData(SceneType sceneType, Vector3 position, Data data, bool hasAnimation, int minDepth, bool inStack)
 {
     SceneType = sceneType;
     Position = position;
     Data = data;
     HasAnimation = hasAnimation;
     MinDepth = minDepth;
     InStack = inStack;
 }
コード例 #7
0
    public static void LoadGameScene()
    {
        CurrentScene = SceneType.Game;
        //Application.LoadLevel("BombermanScene");
        AsyncOperation async = Application.LoadLevelAsync("BombermanScene");

        //yield return async;
        Debug.Log ("Loading complete");
    }
コード例 #8
0
ファイル: WTMain.cs プロジェクト: wtrebella/ImmunityGame
    public void SwitchToScene(SceneType sceneType)
    {
        if (currentScene != null) Futile.RemoveStage(currentScene);

        if (sceneType == SceneType.Immunity) currentScene = new WTImmunity();
        if (sceneType == SceneType.None) currentScene = null;

        if (currentScene != null) Futile.AddStage(currentScene);
    }
コード例 #9
0
        public static void TransferToPreviousScene(SceneType defaultScene)
        {
            // remove current scene.
            _log.RemoveLast();

            // transfer to previous scene.
            var scene = _log.PopOrDefault(defaultScene);
            Transfer(scene);
        }
コード例 #10
0
ファイル: Main.cs プロジェクト: satishinext/php
		private string GetSceneNameFromType(SceneType sceneType)
		{
			string sceneName;
			
			if     (sceneType == SceneType.play) sceneName = "AppPlay";
			else if(sceneType == SceneType.main) sceneName = "AppMain";
			else                                 sceneName = "";
			
			return sceneName;
		}
コード例 #11
0
ファイル: Main.cs プロジェクト: satishinext/php
		public void loadScene(SceneType sceneType, Dictionary<string, System.Object> sceneData = null)
		{
			string sceneName = GetSceneNameFromType(sceneType);
			
			if(sceneName.Length > 0)
			{
				currSceneType = sceneType;
				currSceneData = sceneData;
				
				Application.LoadLevel(sceneName);
			}
		}
コード例 #12
0
ファイル: Main.cs プロジェクト: satishinext/php
		private Main() 
		{
			currSceneType = GetSceneTypeFromName(Application.loadedLevelName);
			currSceneData = null;
			
			SceneType firstScene = SceneType.main;
			
			if(currSceneType != firstScene)
			{
				loadScene(firstScene);
			}
		}
コード例 #13
0
ファイル: WTMain.cs プロジェクト: wtrebella/FutilePrototyper
    public void SwitchToScene(SceneType sceneType)
    {
        if (currentScene != null) Futile.RemoveStage(currentScene);

        if (sceneType == SceneType.Compartments) currentScene = new WTCompartments();
        if (sceneType == SceneType.BlahGame) currentScene = new WTBlahGame();
        if (sceneType == SceneType.FrendenGame) currentScene = new WTFrendenGame();
        if (sceneType == SceneType.Hexagon) currentScene = new WTHexagon();
        if (sceneType == SceneType.None) currentScene = null;

        if (currentScene != null) Futile.AddStage(currentScene);
    }
コード例 #14
0
ファイル: SceneManager.cs プロジェクト: 84110/BattleArms
    GameObject CreateScene(SceneType scene_type)
    {
        var scene_prefab = scene_list_.ContainsKey(scene_type) ?
            scene_list_[scene_type] : scene_list_[SceneType.TITLE];

        var scene = Instantiate(scene_prefab);
        scene.name = scene_prefab.name;

        current_scene_ = scene;

        return scene;
    }
コード例 #15
0
    public void SetScene(SceneType sceneType)
    {
        if((Scene)_sceneList[sceneType])
        {
            if(_currentScene)
                _currentScene.Deactivate();

            _currentScene = (Scene)_sceneList[sceneType];
            _currentSceneType = sceneType;
            _currentScene.Activate();
        }
        else
        {
            Debug.LogError("No scene of type " + sceneType + " exists!");
        }
    }
コード例 #16
0
ファイル: WTMain.cs プロジェクト: wtrebella/SuperBlackout
    public static void SwitchToScene(SceneType sceneType)
    {
        if (currentScene != null) Futile.RemoveStage(currentScene);

        if (sceneType == SceneType.GameScene) {
            currentScene = new SBGameScene(true);
            FSoundManager.StopMusic();
        }
        if (sceneType == SceneType.TitleScene) {
            currentScene = new SBTitleScene();
            Futile.AddStage(currentScene);
        }
        if (sceneType == SceneType.HelpScene) {
            currentScene = new SBHelpScene();
            Futile.AddStage(currentScene);
        }
        if (sceneType == SceneType.None) currentScene = null;
    }
コード例 #17
0
 public void StartFade(Type type, SceneType scene, float length)
 {
     this.targetScene = scene;
     this.length = length;
     this.elapsedTime = 0;
     switch (type) {
         case Type.FadeIn:
             this.type = Type.FadeIn;
             alpha = 1;
             break;
         case Type.FadeOut:
             this.type = Type.FadeOut;
             alpha = 0;
             break;
         case Type.FadeOutIn:
             this.type = Type.FadeOutIn;
             alpha = 0;
             break;
     }
 }
コード例 #18
0
ファイル: SceneMgr.cs プロジェクト: MohanLi/Demo
	/// <summary>
	/// Switchs the scene.
	/// </summary>
	/// <param name="name">要创建的资源路径</param>
    /// <param name="objParams">可变参数</param>
	public void SwitchScene(SceneType sceneType , params object[] objParams)//GameObject
	{
		//GameObject obj = ResourceMsg.GetInstance ().CreateGameObject (name, cache);

		string name = sceneType.ToString ();
        GameObject go = new GameObject(name);
        SceneBase scene = go.AddComponent(Type.GetType(name)) as SceneBase;
        //scene.Init();
        scene.OnInit(objParams);

        if (parentObj == null)
        {
            //此处写法欠妥,还需要改进
            parentObj = GameObject.Find("UI Root").transform;
        }
        go.transform.SetParent(parentObj);
        go.transform.localEulerAngles = Vector3.zero;
        go.transform.localScale = Vector3.one;
        go.transform.localPosition = Vector3.zero;

        //如果是进入到主场景,清空记录
        if (name.Equals(mainScene))
        {
            switchRecorders.Clear();
        }

		switchRecorders.Add(new SwitchRecorder(sceneType, objParams));

		if (currentShow != null) 
		{
			GameObject.Destroy (currentShow);
		}
        currentShow = go;

        LayerMgr.GetInstance().SetLayer(go, LayerType.Scene);
	}
コード例 #19
0
 public void SceneChangedEvent(SceneType type)
 {
 }
コード例 #20
0
ファイル: MainMenuScene.cs プロジェクト: JohanGl/Outworld-XNA
        public void ShowScene(SceneType type)
        {
            // Hide all child scenes
            foreach (var scene in SceneChildren)
            {
                scene.HasFocus = false;
            }

            // Hide all child-scene controls (the first four are static and shouldnt be hidden)
            for (int i = 4; i < gui.Elements.Count; i++)
            {
                gui.Elements[i].Visibility = Visibility.Hidden;
            }

            switch (type)
            {
                case SceneType.Main:
                    title.Text = "MAIN MENU";
                    gui.Elements[4].Visibility = Visibility.Visible;
                    break;

                case SceneType.NewGame:
                    title.Text = "NEW GAME";
                    gui.Elements[5].Visibility = Visibility.Visible;
                    break;

                case SceneType.JoinGame:
                    title.Text = "JOIN GAME";
                    gui.Elements[6].Visibility = Visibility.Visible;
                    break;
            }
        }
コード例 #21
0
		public static extern Handle CreateSceneManager(
			Handle self, 
			SceneType sceneType);
コード例 #22
0
 public static void LoadNewScene(SceneType type)
 {
     SceneManager.LoadScene((int)type);
 }
コード例 #23
0
 public void Remove(SceneType type)
 {
     sceneToRemove.Add(type);
 }
コード例 #24
0
 /// <summary>
 /// 切り替えたいシーンを設定します。
 /// </summary>
 /// <param name="nextScene"></param>
 public static void ChangeScene(SceneType nextScene)
 {
     NextScene        = nextScene;
     Instance.enabled = true;
 }
コード例 #25
0
ファイル: SceneFactory.cs プロジェクト: x00568/ET
        public static async ETTask <Scene> Create(Entity parent, long id, long instanceId, int zone, string name, SceneType sceneType, StartSceneConfig startSceneConfig = null)
        {
            await ETTask.CompletedTask;
            Scene scene = EntitySceneFactory.CreateScene(id, instanceId, zone, sceneType, name, parent);

            scene.AddComponent <MailBoxComponent, MailboxType>(MailboxType.UnOrderMessageDispatcher);

            switch (scene.SceneType)
            {
            case SceneType.Router:
                scene.AddComponent <RouterComponent, IPEndPoint, string>(startSceneConfig.OuterIPPort,
                                                                         startSceneConfig.StartProcessConfig.InnerIP
                                                                         );
                break;

            case SceneType.RouterManager:
                scene.AddComponent <HttpComponent, string>($"http://{startSceneConfig.OuterIPPort}/");
                break;

            case SceneType.Realm:
                scene.AddComponent <NetKcpComponent, IPEndPoint, int>(startSceneConfig.InnerIPOutPort, CallbackType.SessionStreamDispatcherServerOuter);
                break;

            case SceneType.Gate:
                scene.AddComponent <NetKcpComponent, IPEndPoint, int>(startSceneConfig.InnerIPOutPort, CallbackType.SessionStreamDispatcherServerOuter);
                scene.AddComponent <PlayerComponent>();
                scene.AddComponent <GateSessionKeyComponent>();
                break;

            case SceneType.Map:
                scene.AddComponent <UnitComponent>();
                scene.AddComponent <AOIManagerComponent>();
                break;

            case SceneType.Location:
                scene.AddComponent <LocationComponent>();
                break;

            case SceneType.Robot:
                scene.AddComponent <RobotManagerComponent>();

                break;
            }

            return(scene);
        }
コード例 #26
0
 public void SwitchScene(SceneType sceneType)
 {
     _switchingScene = true;
     _switchingSceneType = sceneType;
 }
コード例 #27
0
        public static Scene CreateScene(long id, long instanceId, int zone, SceneType sceneType, string name, Entity parent = null)
        {
            Scene scene = new Scene(id, instanceId, zone, sceneType, name, parent);

            return(scene);
        }
        /// <summary>
        /// Internal method to handle scene loads
        /// </summary>
        private async Task LoadScenesInternal(
            IEnumerable <string> scenesToLoad,
            SceneType sceneType,
            SceneActivationToken activationToken = null,
            float progressOffset = 0,
            float progressTarget = 1,
            bool sceneOpInProgressWhenFinished = false)
        {
            // If we're using an activation token let it know that we're NOT ready to proceed
            activationToken?.SetReadyToProceed(false);

            SetSceneOpProgress(true, progressOffset, sceneType);

            // Validate our scenes
            List <string> validNames   = new List <string>();
            List <int>    validIndexes = new List <int>();

            foreach (string sceneName in scenesToLoad)
            {
                // See if scene exists
                Scene scene;
                int   sceneIndex;
                if (!RuntimeSceneUtils.FindScene(sceneName, out scene, out sceneIndex))
                {
                    Debug.LogError("Can't load invalid scene " + sceneName);
                }
                else
                {
                    validIndexes.Add(sceneIndex);
                    validNames.Add(sceneName);
                }
            }

            int totalSceneOps = validIndexes.Count;

            if (totalSceneOps < 1)
            {
                Debug.LogWarning("No valid scenes found to load.");
                SetSceneOpProgress(sceneOpInProgressWhenFinished, progressTarget, sceneType);
                return;
            }

            // We're about to load scenes - let everyone know
            InvokeWillLoadActions(validNames, sceneType);

            // Load our scenes
            if (validIndexes.Count > 0)
            {
                List <AsyncOperation> loadSceneOps = new List <AsyncOperation>();
                foreach (int sceneIndex in validIndexes)
                {
                    Scene scene = SceneManager.GetSceneByBuildIndex(sceneIndex);
                    if (scene.isLoaded)
                    {
                        continue;
                    }

                    AsyncOperation sceneOp = SceneManager.LoadSceneAsync(sceneIndex, LoadSceneMode.Additive);
                    // Set this to true unless we have an activation token
                    sceneOp.allowSceneActivation = (activationToken != null) ? activationToken.AllowSceneActivation : true;
                    loadSceneOps.Add(sceneOp);
                }

                // Now wait for all async operations to complete
                bool completedAllSceneOps = false;

                while (!completedAllSceneOps)
                {
                    if (!Application.isPlaying)
                    {   // Break out of this loop if we've stopped playmode
                        return;
                    }

                    completedAllSceneOps = true;
                    bool readyToProceed       = false;
                    bool allowSceneActivation = (activationToken != null) ? activationToken.AllowSceneActivation : true;

                    // Go through all the load scene ops and see if we're ready to be activated
                    float sceneOpProgress = 0;
                    for (int i = 0; i < loadSceneOps.Count; i++)
                    {
                        // Set allow scene activation
                        // (This can be set to true by user before ReadyToProceed is set)
                        loadSceneOps[i].allowSceneActivation = allowSceneActivation;

                        if (loadSceneOps[i].isDone)
                        {   // Sometimes if a scene is small enough, progress will get reset to 0 before you even have a chance to check it
                            // This is true EVEN IF you've set allowSceneActivation to false
                            // So use isDone as a failsafe
                            sceneOpProgress += 1;
                        }
                        else
                        {
                            readyToProceed      |= loadSceneOps[i].progress >= SceneActivationLoadProgress;
                            sceneOpProgress     += loadSceneOps[i].progress;
                            completedAllSceneOps = false;
                        }
                    }

                    // Let the activation know whether we're ready
                    activationToken?.SetReadyToProceed(readyToProceed);

                    sceneOpProgress = Mathf.Clamp01(SceneOperationProgress / totalSceneOps);

                    SetSceneOpProgress(true, Mathf.Lerp(progressOffset, progressTarget, sceneOpProgress), sceneType);

                    await Task.Yield();
                }
            }

            // Wait for all scenes to be fully loaded before proceeding
            bool scenesLoadedAndActivated = false;

            while (!scenesLoadedAndActivated)
            {
                if (!Application.isPlaying)
                {   // Break out of this loop if we've stopped playmode
                    return;
                }

                scenesLoadedAndActivated = true;
                foreach (int sceneIndex in validIndexes)
                {
                    Scene scene = SceneManager.GetSceneByBuildIndex(sceneIndex);
                    scenesLoadedAndActivated &= (scene.IsValid() & scene.isLoaded);
                }
                await Task.Yield();
            }

            // Make sure our content tracker is refreshed
            contentTracker.RefreshLoadedContent();

            // We're done!
            SetSceneOpProgress(sceneOpInProgressWhenFinished, progressTarget, sceneType);

            InvokeLoadedActions(validNames, sceneType);
        }
コード例 #29
0
ファイル: SceneFactory.cs プロジェクト: chaoshenzhilu/Copy_ET
        public static async ETTask <Scene> Create(Entity parent, long id, int zone, string name, SceneType sceneType, StartSceneConfig startSceneConfig = null)
        {
            Scene scene = EntitySceneFactory.CreateScene(id, zone, sceneType, name);

            scene.Parent = parent;

            scene.AddComponent <MailBoxComponent, MailboxType>(MailboxType.UnOrderMessageDispatcher);

            switch (scene.SceneType)
            {
            case SceneType.Realm:
                scene.AddComponent <NetOuterComponent, string>(startSceneConfig.OuterAddress);
                break;

            case SceneType.Gate:
                scene.AddComponent <NetOuterComponent, string>(startSceneConfig.OuterAddress);
                scene.AddComponent <PlayerComponent>();
                scene.AddComponent <GateSessionKeyComponent>();
                break;

            case SceneType.Map:
                scene.AddComponent <UnitComponent>();
                break;

            case SceneType.Location:
                scene.AddComponent <LocationComponent>();
                break;
            }

            return(scene);
        }
コード例 #30
0
 public Scene(SceneType sceneType)
 {
     this.SceneType = sceneType;
 }
コード例 #31
0
 public SceneLoadedEventArgs(SceneType scene)
 {
     Scene = scene;
 }
コード例 #32
0
 public void goToScene(MainGame mG, SceneType sT)
 {
     mG.gameState.ChangeScene(sT);
 }
コード例 #33
0
ファイル: Game1.cs プロジェクト: sytelus/StartTrek
        private void HandleKeyboardShortcuts(KeyboardState keyState)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();
            if (keyState.IsKeyDown(Keys.R) && keyDelay.ElapsedMilliseconds > 400)
            {
                ResetScene(true);
                keyDelay.Restart();
            }
            if (keyState.IsKeyDown(Keys.S) && keyDelay.ElapsedMilliseconds > 400)
            {
                currentScene = (SceneType) (((int) currentScene + 1)%2);
                ResetScene(true);
                keyDelay.Restart();
            }
            if (keyState.IsKeyDown(Keys.D) && keyDelay.ElapsedMilliseconds > 400)
            {
                foreach (var object3D in this.scene.Objects)
                    object3D.DebugLevel = (Object3D.DebugLevelType) (((int)object3D.DebugLevel + 1)%3);

                keyDelay.Restart();
            }
        }
コード例 #34
0
 protected Scene(Session session, SceneType type)
 {
     Session = session;
     Type    = type;
 }
コード例 #35
0
ファイル: Scene.cs プロジェクト: ZelimDamian/OpenTK-for-VTK-
        public static void Update()
        {
            if(Window.Keyboard[OpenTK.Input.Key.E])
                sceneType = SceneType.Emblems;
            else if(Window.Keyboard[OpenTK.Input.Key.N])
                sceneType = SceneType.Numad;

            Scene.Update();
        }
コード例 #36
0
 public static void LoadMainScene()
 {
     CurrentScene = SceneType.MainMenu;
     Application.LoadLevel("MainMenu");
 }
コード例 #37
0
    //public IEnumerator StartGamemode(string gameMode)
    public IEnumerator StartGamemode(SceneType gameMode)
    {
        currentRoomSize = RoomSize;
        switch (gameMode)
        {
        case SceneType.Corrida:

            CorridaFade.SetActive(true);

            spawnHUBPoints.Value = 5;

            yield return(new WaitForSeconds(tempoPraFade));

            DelayStartWaitingRoomController.minPlayerToStart = 2;
            DelayStartWaitingRoomController.tutorialMode     = false;
            DelayStartWaitingRoomController.gameMode         = gameMode;
            gameModeAtual = "Corrida";
            if (PhotonNetwork.OfflineMode == false)
            {
                OnJoinRoomButton(gameModeAtual);
            }
            else
            {
                CreateRoomWithMode(gameModeAtual);
            }
            break;

        case SceneType.Coleta:

            ColetaFade.SetActive(true);

            spawnHUBPoints.Value = 1;

            yield return(new WaitForSeconds(tempoPraFade));

            DelayStartWaitingRoomController.minPlayerToStart = 2;
            DelayStartWaitingRoomController.tutorialMode     = false;
            DelayStartWaitingRoomController.gameMode         = gameMode;
            gameModeAtual = "Coleta";
            if (PhotonNetwork.OfflineMode == false)
            {
                OnJoinRoomButton(gameModeAtual);
            }
            else
            {
                CreateRoomWithMode(gameModeAtual);
            }

            break;

        case SceneType.Futebol:

            FutebolFade.SetActive(true);

            spawnHUBPoints.Value = 2;

            yield return(new WaitForSeconds(tempoPraFade));

            currentRoomSize = 2;
            DelayStartWaitingRoomController.minPlayerToStart = 2;
            DelayStartWaitingRoomController.tutorialMode     = false;
            DelayStartWaitingRoomController.gameMode         = gameMode;
            gameModeAtual = "Futebol";
            if (PhotonNetwork.OfflineMode == false)
            {
                OnJoinRoomButton(gameModeAtual);
            }
            else
            {
                CreateRoomWithMode(gameModeAtual);
            }

            break;

        case SceneType.Volei:

            VoleiFade.SetActive(true);

            spawnHUBPoints.Value = 4;

            yield return(new WaitForSeconds(tempoPraFade));

            currentRoomSize = 2;
            DelayStartWaitingRoomController.minPlayerToStart = 2;
            DelayStartWaitingRoomController.tutorialMode     = false;
            DelayStartWaitingRoomController.gameMode         = gameMode;
            gameModeAtual = "Volei";
            if (PhotonNetwork.OfflineMode == false)
            {
                OnJoinRoomButton(gameModeAtual);
            }
            else
            {
                CreateRoomWithMode(gameModeAtual);
            }

            break;

        case SceneType.Moto:

            MotoFade.SetActive(true);

            spawnHUBPoints.Value = 3;

            yield return(new WaitForSeconds(tempoPraFade));

            DelayStartWaitingRoomController.minPlayerToStart = 2;
            DelayStartWaitingRoomController.tutorialMode     = false;
            DelayStartWaitingRoomController.gameMode         = gameMode;
            gameModeAtual = "Moto";
            if (PhotonNetwork.OfflineMode == false)
            {
                OnJoinRoomButton(gameModeAtual);
            }
            else
            {
                CreateRoomWithMode(gameModeAtual);
            }

            break;


        default:                                                                                                            //Caso padrão vai pro Tutorial

            ColetaFade.SetActive(true);

            spawnHUBPoints.Value = 1;

            yield return(new WaitForSeconds(tempoPraFade));

            DelayStartWaitingRoomController.minPlayerToStart = 2;
            DelayStartWaitingRoomController.tutorialMode     = false;
            DelayStartWaitingRoomController.gameMode         = gameMode;
            gameModeAtual = "Tutorial";
            if (PhotonNetwork.OfflineMode == false)
            {
                OnJoinRoomButton(gameModeAtual);
            }
            else
            {
                CreateRoomWithMode(gameModeAtual);
            }

            break;
        }
    }
コード例 #38
0
 /// <summary>
 /// 切换到LogOn场景
 /// </summary>
 public void LoadLogOn()
 {
     m_CurtType = SceneType.LogOn;
     SceneManager.LoadScene("02UIRoot_Loading");
 }
コード例 #39
0
    /// <summary>
    /// シーンのアンロード
    /// </summary>
    /// <param name="type"></param>
    public void UnloadScene(SceneType type, System.Action EndCallBack = null)
    {
        EndLoadCallback = EndCallBack;

        StartCoroutine(IESceneUnload(type, EndCallBack));
    }
コード例 #40
0
 public void Push(SceneType scene)
 {
     _stack.AddLast(scene);
     while (_stack.Count > Capacity)
         _stack.RemoveFirst();
 }
コード例 #41
0
ファイル: SceneFactory.cs プロジェクト: chaoshenzhilu/Copy_ET
        public static async ETTask <Scene> Create(Entity parent, string name, SceneType sceneType)
        {
            long id = IdGenerater.GenerateId();

            return(await Create(parent, id, parent.DomainZone(), name, sceneType));
        }
コード例 #42
0
 public void TransitScene(SceneType next)
 {
     StartCoroutine(TransitSceneCoroutine(next));
 }
        /// <summary>
        /// Internal method to handles scene unloads
        /// </summary>
        private async Task UnloadScenesInternal(
            IEnumerable <string> scenesToUnload,
            SceneType sceneType,
            float progressOffset = 0,
            float progressTarget = 1,
            bool sceneOpInProgressWhenFinished = false)
        {
            SetSceneOpProgress(true, progressOffset, sceneType);

            List <string> validNames   = new List <string>();
            List <int>    validIndexes = new List <int>();

            foreach (string sceneName in scenesToUnload)
            {
                // See if scene exists
                Scene scene;
                int   sceneIndex;
                if (!RuntimeSceneUtils.FindScene(sceneName, out scene, out sceneIndex))
                {
                    Debug.LogError("Can't unload invalid scene " + sceneName);
                }
                else
                {
                    validIndexes.Add(sceneIndex);
                    validNames.Add(sceneName);
                }
            }

            int totalSceneOps = validIndexes.Count;

            if (totalSceneOps < 1)
            {
                Debug.LogWarning("No valid scenes found to unload.");
                SetSceneOpProgress(sceneOpInProgressWhenFinished, progressTarget, sceneType);
                return;
            }

            // Invoke our actions
            InvokeWillUnloadActions(validNames, sceneType);

            // Unload our scenes
            if (validIndexes.Count > 0)
            {
                List <AsyncOperation> unloadSceneOps = new List <AsyncOperation>();
                foreach (int sceneIndex in validIndexes)
                {
                    Scene scene = SceneManager.GetSceneByBuildIndex(sceneIndex);
                    if (!scene.isLoaded)
                    {
                        continue;
                    }

                    AsyncOperation sceneOp = SceneManager.UnloadSceneAsync(sceneIndex);
                    unloadSceneOps.Add(sceneOp);
                }

                // Now wait for all async operations to complete
                bool  completedAllSceneOps = false;
                float sceneOpProgress      = 0;
                while (!completedAllSceneOps)
                {
                    if (!Application.isPlaying)
                    {   // Break out of this loop if we've stopped playmode
                        return;
                    }

                    completedAllSceneOps = true;
                    sceneOpProgress      = 0;
                    for (int i = 0; i < unloadSceneOps.Count; i++)
                    {
                        sceneOpProgress      += unloadSceneOps[i].progress;
                        completedAllSceneOps &= unloadSceneOps[i].isDone;
                    }
                    sceneOpProgress = Mathf.Clamp01(SceneOperationProgress / totalSceneOps);

                    SetSceneOpProgress(true, Mathf.Lerp(progressOffset, progressTarget, sceneOpProgress), sceneType);

                    await Task.Yield();
                }
            }

            // Wait for all scenes to be fully unloaded before proceeding
            bool scenesUnloaded = false;

            while (!scenesUnloaded)
            {
                if (!Application.isPlaying)
                {   // Break out of this loop if we've stopped playmode
                    return;
                }

                scenesUnloaded = true;
                foreach (int sceneIndex in validIndexes)
                {
                    Scene scene = SceneManager.GetSceneByBuildIndex(sceneIndex);
                    scenesUnloaded &= !scene.isLoaded;
                }
                await Task.Yield();
            }

            // Make sure our content tracker is refreshed
            contentTracker.RefreshLoadedContent();

            // We're done!
            SetSceneOpProgress(sceneOpInProgressWhenFinished, progressTarget, sceneType);

            // Invoke our actions
            InvokeUnloadedActions(validNames, sceneType);
        }
コード例 #44
0
    private IEnumerator TransitSceneCoroutine(SceneType next)
    {
        yield return(new WaitForSeconds(FadeSwitch()));

        Application.LoadLevel((int)next);
    }
コード例 #45
0
 public NavigateAction(SceneType scene)
 {
     Scene = scene;
 }
コード例 #46
0
ファイル: UIConfiguration.cs プロジェクト: einsof/HOTest
 public UIScene GetScene(SceneType type)
 {
     return(_scenes.FirstOrDefault(x => x.Type == type));
 }
コード例 #47
0
 public StageSelect(GameObjectManager objectManager, ISceneManager sceneManager, SceneType sceneType) :
     base(objectManager, sceneManager, sceneType)
 {
 }
コード例 #48
0
ファイル: SceneChanger.cs プロジェクト: ftvoid/KawaiiParade
 /// <summary>
 /// シーンの遷移
 /// </summary>
 /// <param name="type"></param>
 /// <param name="param"></param>
 public void ChangeScene(SceneType type, object param = null)
 {
     Param = param;
     SceneManager.LoadScene((int)type);
 }
コード例 #49
0
 public static void LoadGameRoomScene()
 {
     CurrentScene = SceneType.GameRoom;
     Application.LoadLevel ("GameRoom");
 }
コード例 #50
0
 /// <summary>
 /// 进入下一个场景
 /// </summary>
 /// <param name="scenesEnumName">场景(枚举)名称</param>
 protected void EnterNextScenes(SceneType sceneName)
 {
     //转到下一个场景
     GlobalParametersManager.NextSceneTYPE = sceneName;
     Application.LoadLevel(ConvertEnumToString.Instacne.GetSceneStrBySceneType(GlobalParametersManager.NextSceneTYPE));
 }
コード例 #51
0
 public static void LoadLobbyScene()
 {
     CurrentScene = SceneType.Lobby;
     Application.LoadLevel("Lobby");
 }
コード例 #52
0
 void OnDisableInitialMaskIfNeed()
 {
     changeSceneType = SceneType.NONE;
     CommonFSM.Instance.SendFsmNextEvent();
 }
コード例 #53
0
 public static void LoadStartScene()
 {
     CurrentScene = SceneType.Start;
     Application.LoadLevel("Start");
 }
コード例 #54
0
 public override void OnLeaveScenel(SceneType level, Action action = null)
 {
     base.OnLeaveScenel(level, action);
 }
コード例 #55
0
 /// <summary>
 /// 切换到MainCity场景
 /// </summary>
 public void LoadMainCity()
 {
     m_CurtType = SceneType.MainCity;
     SceneManager.LoadScene("02UIRoot_Loading");
 }
コード例 #56
0
        public scene.Scene CreateScene(SceneType type, PitchPitch parent, object arg = null)
        {
            if (_scenes == null)
            {
                _scenes = new Dictionary <SceneType, Scene>();
            }

            Scene scene = null;

            if (_scenes.ContainsKey(type))
            {
                scene = _scenes[type];
                switch (type)
                {
                case SceneType.GameStage:
                    (scene as scene.SceneGameStage).Map = arg as map.Map;
                    break;

                case SceneType.Error:
                    (scene as scene.SceneError).ErrorMessages = (string[])arg;
                    break;
                }
            }
            else
            {
                switch (type)
                {
                case SceneType.Error:
                    scene = new SceneError();
                    (scene as scene.SceneError).ErrorMessages = (string[])arg;
                    break;

                case SceneType.Title:
                    scene = new SceneTitle();
                    break;

                case SceneType.MapSelect:
                    scene = new SceneMapSelect();
                    break;

                case SceneType.Option:
                    scene = new SceneOption();
                    break;

                case SceneType.GameStage:
                    scene = new SceneGameStage(arg as map.Map);
                    break;

                case SceneType.GameOver:
                    scene = new SceneGameOver();
                    break;

                default:
                    return(null);
                }
                _scenes.Add(type, scene);
            }
            if (scene != null)
            {
                scene.Init(parent);
            }
            return(scene);
        }
コード例 #57
0
 internal SwitchRecorder(SceneType sceneType, params object[] sceneArgs)
 {
     this.sceneType = sceneType;
     this.sceneArgs = sceneArgs;
 }
コード例 #58
0
 void SwitchSceneVR( )
 {
     TypeOfScene = SceneType.VR;
     SwitchScene();
 }
コード例 #59
0
		public static extern Handle CreateSceneManager(
			Handle self, 
			SceneType sceneType, 
			[MarshalAs(UnmanagedType.LPStr)] String instanceName);
コード例 #60
0
 void SwitchSceneARVR( )
 {
     TypeOfScene = SceneType.ARVR;
     SwitchScene();
 }