Exemplo n.º 1
0
        private IEnumerator CreateMonster(string modelName)
        {
            if (string.IsNullOrEmpty(modelName))
            {
                yield break;
            }

            if (modelName == ModelName)
            {
                yield break;
            }

            ModelName = modelName;
            if (Lobby == null && Loader == null)
            {
                Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);
                UI3DLobby.Preload(modelName);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = mMonsterTex.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture  = mMonsterTex;
                    Lobby.CharacterPoolSize = CharacterPoolSize;
                    Lobby.SetCameraMode(1.5f, true);
                }
            }

            if (Lobby != null)
            {
                Lobby.VariantName = modelName;
                while (Lobby.Current == null || Lobby.Current.character == null)
                {
                    yield return(null);
                }
                Lobby.SetCharMoveState(MoveController.CombatantMoveState.kReady);
            }
        }
Exemplo n.º 2
0
        private IEnumerator CreateBossModel(string modelName)
        {
            isInitLobby = true;
            if (string.IsNullOrEmpty(modelName))
            {
                isInitLobby = false;
                yield break;
            }

            if (modelName == ModelName)
            {
                isInitLobby = false;
                yield break;
            }

            ModelName = modelName;
            if (Lobby == null && Loader == null)
            {
                Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);
                UI3DLobby.Preload(modelName);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = LobbyTexture.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture  = LobbyTexture;
                    Lobby.CharacterPoolSize = CharacterPoolSize;
                    Camera Camera = Lobby.mDMono.transform.Find("UI3DCamera").GetComponent <Camera>();
                    Camera.orthographicSize = 4.2f;
                }
            }

            if (Lobby != null)
            {
                Lobby.VariantName = modelName;
                yield return(null);

                Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true);
            }
            isInitLobby = false;
        }
Exemplo n.º 3
0
        private IEnumerator CreateBuddyModel(UITexture LobbyTexture, string modelName, bool isPlayLight, bool isplayEntry)
        {
            isInitLobby = true;
            if (string.IsNullOrEmpty(modelName))
            {
                isInitLobby = false;
                yield break;
            }
            if (modelName == ModelName)
            {
                if (Lobby != null)
                {
                    if (!Lobby.mDMono.gameObject.activeSelf)
                    {
                        Lobby.mDMono.gameObject.CustomSetActive(true);
                    }
                    Lobby.SetCharMoveState(MoveController.CombatantMoveState.kIdle);
                    yield return(null);

                    LobbyTexture.enabled = true;
                }
                isInitLobby = false;
                if (!isPlayLight)
                {
                    bloom.thresholdGamma = 1.0f;
                }
                yield return(new WaitForSeconds(0.3f));

                if (isplayEntry)
                {
                    Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true);
                }
                yield break;
            }
            LobbyTexture.gameObject.CustomSetActive(false);
            ModelName    = modelName;
            isModelReady = false;
            UI3DLobby.PreloadWithCallback(modelName, delegate { isModelReady = true; });
            if (Lobby == null && Loader == null)
            {
                Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.SetParent(LobbyTexture.transform);
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture  = LobbyTexture;
                    Lobby.CharacterPoolSize = CharacterPoolSize;
                    Camera Camera = Lobby.mDMono.transform.Find("UI3DCamera").GetComponent <Camera>();
                    Camera.orthographicSize = 2.0f;
                }
            }
            LobbyTexture.gameObject.CustomSetActive(true);
            while (!isModelReady)
            {
                yield return(null);
            }

            if (Lobby != null)
            {
                if (!Lobby.mDMono.gameObject.activeSelf)
                {
                    Lobby.mDMono.gameObject.CustomSetActive(true);
                }
                Lobby.VariantName = modelName;
                Lobby.SetCharMoveState(MoveController.CombatantMoveState.kIdle);
                yield return(null);

                LobbyTexture.enabled = true;
            }
            RenderSettings rs = controller.transform.GetComponentInChildren <RenderSettings>();

            if (rs != null)
            {
                EB.Debug.Log("rendersetting set : {0}", rs.name);
                RenderSettingsManager.Instance.SetActiveRenderSettings(rs.name, rs);
            }
            else
            {
                EB.Debug.LogWarning("rendersetting is null");
            }
            isInitLobby = false;
            Lobby.SetBloomUITexture(LobbyTexture);
            bloom = Lobby.BloomCamera.GetComponent <Max820.Bloom>();
            while (isPlayLight && bloom.thresholdGamma > 0.15f)
            {
                Lobby.BloomCamera.gameObject.CustomSetActive(true);
                bloom.thresholdGamma = Mathf.Lerp(bloom.thresholdGamma, 0.1f, 0.1f);
                yield return(new WaitForEndOfFrame());
            }
            if (!isPlayLight)
            {
                bloom.thresholdGamma = 1.0f;
            }
            yield return(new WaitForSeconds(0.3f));

            if (isplayEntry)
            {
                Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true);
            }
        }
Exemplo n.º 4
0
        private IEnumerator CreateBuddyModel(string modelName)
        {
            if (string.IsNullOrEmpty(modelName))
            {
                isInitLobby = false;
                yield break;
            }

            if (modelName == ModelName)
            {
                if (Lobby != null)
                {
                    if (!Lobby.mDMono.gameObject.activeSelf)
                    {
                        Lobby.mDMono.gameObject.CustomSetActive(true);
                    }

                    Lobby.SetCharMoveState(MoveController.CombatantMoveState.kIdle);
                    yield return(null);

                    LobbyTexture.enabled = true;
                    Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true);
                }

                isInitLobby = false;
                yield break;
            }

            ModelName    = modelName;
            isModelReady = false;
            UI3DLobby.PreloadWithCallback(modelName, delegate { isModelReady = true; });

            if (Lobby == null && Loader == null)
            {
                Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.SetParent(LobbyTexture.transform);
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                    Lobby.ConnectorTexture  = LobbyTexture;
                    Lobby.CharacterPoolSize = CharacterPoolSize;
                    Camera Camera = Lobby.mDMono.transform.Find("UI3DCamera").GetComponent <Camera>();
                    Camera.orthographicSize = 1.25f;
                }
            }

            while (!isModelReady)
            {
                yield return(null);
            }

            if (Lobby != null)
            {
                if (!Lobby.mDMono.gameObject.activeSelf)
                {
                    Lobby.mDMono.gameObject.CustomSetActive(true);
                }

                Lobby.VariantName = modelName;
                Lobby.SetCharMoveState(MoveController.CombatantMoveState.kIdle);
                yield return(null);

                LobbyTexture.enabled = true;
                Lobby.SetCharMoveState(MoveController.CombatantMoveState.kEntry, true);
            }

            isInitLobby = false;
        }