Inheritance: MonoBehaviour
Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        loadingScene = GameObject.FindGameObjectWithTag("LoadingUI").gameObject.GetComponent <LoadingScene>();


        int i = GameController.floor / GameController.floor_space;

        if (isTitle)
        {
            return;
        }

        if (skyboxes[0] && skyboxes[1])
        {
            skyboxes[0].material = skybox_materials[i];
            skyboxes[1].material = skybox_materials[i];
        }


        LoadData();

        friend_now = PlayerPrefsUtility.LoadList <string>("NowFriends");
        //Friendの自動召喚
        if (friend_now.Count > 0)
        {
            for (int r = 0; r < friend_now.Count; r++)
            {
                FriendInstantiate(friend_now[r]);
            }
        }
    }
    public InteractionObject()
    {
        keysForText[""]           = "상호 작용할 대상이 없습니다.";
        keysForText["Legend"]     = "포탈을 이용한다.";
        keysForText["BlackSmith"] = "상태 및 아이템을 관리한다.";
        keysForText["Warrior"]    = "테스트할 몬스터가 활성화 됩니다.";
        keysForText["Tresure"]    = "상자를 엽니다.";

        keysForEvent["Legend"] = () =>
        {
            LoadingScene.LoadScene("Map");
        };
        keysForEvent["BlackSmith"] = () =>
        {
            LoadingScene.LoadScene("Status");
        };
        keysForEvent["Warrior"] = () =>
        {
            //
        };
        keysForEvent["Tresure"] = () =>
        {
            GameObject.Find("Tresure").SetActive(false);
            BattleSceneCtrl.instance.CallEvent();
            BattleSceneCtrl.instance.interactionPanel.SetActive(false);
        };
    }
Beispiel #3
0
    IEnumerator _exit(float delay)
    {
        while (syncQueue.Count > 0)
        {
            yield return(new WaitForEndOfFrame());
        }

        ReplayMgr rm   = ReplayMgr.GetInstance();
        GameMgr   gm   = GameMgr.GetInstance();
        RoomMgr   room = RoomMgr.GetInstance();

        ResourcesMgr.GetInstance().release();

        rm.clear();
        gm.Reset();
        room.reset();

        if (delay > 0)
        {
            PUtils.setTimeout(() => {
                LoadingScene.LoadNewScene("02.lobby");
            }, delay);
        }
        else
        {
            LoadingScene.LoadNewScene("02.lobby");
        }
    }
Beispiel #4
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         LoadingScene.LoadScene(SceneManager.GetActiveScene().name);
     }
 }
Beispiel #5
0
        public void Start()
        {
            var levelName         = GetParameter(0);
            var loadingSceneIndex = GetParameterAsInt(1, -1);
            var spawnpoint        = GetParameter(2);

            if (string.IsNullOrEmpty(levelName))
            {
                if (DialogueDebug.LogWarnings)
                {
                    Debug.LogWarning("Dialogue System: Sequencer: LoadingSceneTo(" + GetParameters() + ") level name is an empty string");
                }
            }
            else
            {
                if (DialogueDebug.LogInfo)
                {
                    Debug.Log("Dialogue System: Sequencer: LoadingSceneTo(" + levelName + ", " + loadingSceneIndex + ", " + spawnpoint + ")");
                }
                DialogueLua.SetActorField("Player", "Spawnpoint", spawnpoint);
                var saveHelper = FindObjectOfType <SaveHelper>();
                if (saveHelper != null)
                {
                    saveHelper.LoadLevel(levelName, loadingSceneIndex);
                }
                else
                {
                    PersistentDataManager.LevelWillBeUnloaded();
                    LoadingScene.SetDestinationScene(levelName);
                    SceneManager.LoadScene(loadingSceneIndex);
                }
            }
            Stop();
        }
Beispiel #6
0
 private void OnDestroy()
 {
     if (gameObject.name.Equals("StoryBGM"))
     {
         LoadingScene.ShowLoadingScene("start", true);
     }
 }
 void Update()
 {
     if (OpenGame && Input.GetMouseButtonDown(0))
     {
         LoadingScene.LoadScene("Battle");
     }
 }
Beispiel #8
0
    public void BackToGameScene()
    {
        audioControll.playBackSound();

        LoadingScene lc = GameObject.Find("Script").GetComponent <LoadingScene> ();

        if (lc != null)
        {
            if (SceneManage.GetPrevSceneName().Equals("GP_Menu"))
            {
                lc.LoadScene("GP_Menu");
            }
            else if (SceneManage.GetPrevSceneName().Equals("JP_Menu"))
            {
                lc.LoadScene("JP_Menu");
            }
            else if (SceneManage.GetPrevSceneName().Equals("JP_MenuWithChoice"))
            {
                lc.LoadScene("JP_MenuWithChoice");
            }
            else if (SceneManage.GetPrevSceneName().Equals("GP_MenuWithChoice"))
            {
                lc.LoadScene("GP_MenuWithChoice");
            }
            else
            {
                lc.LoadScene("MainMenu");
            }
        }
        else
        {
            SceneManager.LoadSceneAsync("MainMenu");
        }
    }
Beispiel #9
0
    public override void ShowDialog(DialogAbs.CallBackShowDialog callback = null)
    {
        Show = true;
        CommonObjectScript.isViewComplete = true;
        bgMain.FindChild("Logo").FindChild("Title").GetComponent <UILabel>().text         = MissionControl.Language["COMPLETE"];
        bgMain.FindChild("Cancel").FindChild("LabelCancel").GetComponent <UILabel>().text = MissionControl.Language["Cancel"];
        bgMain.FindChild("Ok").FindChild("LabelOK").GetComponent <UILabel>().text         = MissionControl.Language["Ok"];
        bgMain.FindChild("TextShow").GetComponent <UILabel>().text = MissionControl.Language["Quest_finish_detail"];
        int addGold = (int)(CommonObjectScript.maxTimeOfMission * 200);

        bgMain.FindChild("TextShow1").GetComponent <UILabel>().text = CommonObjectScript.maxTimeOfMission + " " + MissionControl.Language["day_reamain_equal"] + " = ";
        bgMain.FindChild("TextShow2").GetComponent <UILabel>().text = "" + addGold;
        //An bang task khi hien thi result
        CommonObjectScript.isViewPoppup = true;
        GameObject task = GameObject.Find("DialogTask").gameObject;

        if (task != null)
        {
            task.GetComponent <DialogTask>().HideButton();
        }
        bgMain.gameObject.SetActive(true);
        bgBlack.gameObject.SetActive(true);
        LeanTween.scale(bgMain.gameObject, new Vector3(1, 1, 1), 0.4f).setUseEstimatedTime(true).setEase(LeanTweenType.easeOutBack).setOnComplete(() =>
        {
            Time.timeScale = 0;
        });
        //Hide loading scene if it is showing
        LoadingScene.HideLoadingScene();
    }
Beispiel #10
0
    public void OkButton()
    {
        CommonObjectScript.isViewPoppup = false;
        Time.timeScale = 1;
        print("aaaaaaaaaaa");
        Debug.Log("------------------OK BUTTTON--------------------" + star);

        LeanTween.scale(bgMain.gameObject, new Vector3(0, 0, 0), 0.4f).setEase(LeanTweenType.easeInBack).setUseEstimatedTime(true).setOnComplete(() =>
        {
            RemoveAllItem();
            bgMain.gameObject.SetActive(false);
            bgBlack.gameObject.SetActive(false);
            star1.gameObject.SetActive(false);
            star2.gameObject.SetActive(false);
            star3.gameObject.SetActive(false);
            // CameraController.isViewPopup = false;
            transform.FindChild("SpriteBlack").gameObject.SetActive(false);
            //Application.LoadLevel("Mission");
            LoadingScene.ShowLoadingScene("Mission", true);

            //HungBV 19/01
            //FactoryScenesController.isCreat = false;
            //TownScenesController.isCreat = false;
            //CreatAndControlPanelHelp.countClickHelpPanel = 0;
            Destroy(gameObject);
        });
    }
Beispiel #11
0
 private void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Beispiel #12
0
 void Update()
 {
     if (!Application.loadedLevelName.Equals("Factory"))
     {
         Destroy(gameObject);
     }
     if (isMove)
     {
         if (transform.position.x != changePointPosition.x && !isTurnRight)
         {
             transform.position = Vector2.MoveTowards(transform.position, changePointPosition, 1.5f * Time.deltaTime);
         }
         else
         {
             isTurnRight = true;
             if (transform.position.x != changeEndPosition.x)
             {
                 transform.position = Vector2.MoveTowards(transform.position, changeEndPosition, 1.5f * Time.deltaTime);
             }
             else
             {
                 if (CommonObjectScript.isGuide && VariableSystem.mission == 1)
                 {
                     FactoryScenesController.isHelp = false;
                     //Application.LoadLevel("Farm");
                     LoadingScene.ShowLoadingScene("Farm", true);
                 }
                 Destroy(gameObject);
             }
         }
     }
 }
Beispiel #13
0
    public void EndAnimationComrfirm()
    {
        //CommonObjectScript.isViewPoppup = false;
        if (iDButtonComfirmApply == 1)
        {
            this.gameObject.SetActive(false);
            if (idButton == 2)
            {
                commonObject.GetComponent <CommonObjectScript>().ResultButtonVisible();
                commonObject.GetComponent <CommonObjectScript>().typeReasearch = 1;

                //Application.LoadLevel("VilageResearch");
                LoadingScene.ShowLoadingScene("VilageResearch", true);
                VilageResearchController.ResetVilage();
            }
            else if (idButton == 3)
            {
                maketPopup.gameObject.SetActive(true);
            }
            else
            {
                CreatTownScenesController.isDenyContinue = false;
            }
        }
        else if (iDButtonComfirmApply == 2)
        {
            //  this.gameObject.SetActive(false);
        }
        isApply = false;
    }
Beispiel #14
0
    //读取场景
    public void LoadSceneIndex(int i)
    {
        //如果没有遮罩
        if (null == panel)
        {
            panel = Resources.Load <GameObject>("Prefabs/GameUI-Panel");
        }
        Transform _panel = Instantiate(panel).transform;

        _panel.transform.SetParent(UICanvas, false);
        _panel.transform.SetAsLastSibling();
        if (null == loadS) //如果场景中没有该页面,则重新生成
        {
            //string path = Application.dataPath + "Prefabs/UI/LoadScenePanel";
            GameObject _LoadS = Resources.Load <GameObject>("Prefabs/GameUI-LoadingScene");
            //print("Loaded name of game object: " + _LoadS.name);
            loadS = Instantiate(_LoadS).GetComponent <LoadingScene>();
            loadS.transform.SetParent(this.transform, false);
            loadS.SetPaint(paintOnLoading);
            //loadS.transform.localPosition = Vector2.zero;
        }
        loadS.gameObject.SetActive(true);
        //LoadingScene loadS = Instantiate(loadScenePanel);//实例化预制体
        loadS.LoadSceneIdx(i);
        //loadCanvas ();
    }
Beispiel #15
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         //SteamVR_LoadLevel.Begin("Mountain");
         LoadingScene.LoadScene("Mountain");
     }
 }
        private IEnumerator LoadSceneCoroutine(LoadingScene scene)
        {
            _sceneChangingCanvasGroup.DOFade(1f, _fadeDuration);
            _sceneChangingCanvasGroup.blocksRaycasts = false;
            yield return(new WaitForSeconds(_fadeDuration));

            SceneManager.LoadScene((int)scene);
        }
Beispiel #17
0
    // Update is called once per frame
    public override void Update()
    {
        NetPacket packet = null;

        for (packet = GetPacket(); packet != null;)
        {
            ushort msgid = 0;
            packet.TOID(out msgid);

            switch (msgid)
            {
            case (ushort)MessageIdentifiers.ID.CONNECTION_REQUEST_ACCEPTED:
            {
                Debug.Log("连接到服务器");
                break;
            }

            case (ushort)MessageIdentifiers.ID.CONNECTION_ATTEMPT_FAILED:
            {
                Debug.Log("连接服务器失败,请退出");
                break;
            }

            case (ushort)MessageIdentifiers.ID.CONNCET_LOST:
            {
                Debug.Log("丢失服务器的连接,请按任意键退出");
                break;
            }

            case (ushort)Protocol.ID.LOGIN:
            {
                NetBitStream stream = new NetBitStream();

                stream.BeginRead2(packet);

                stream.DecodeHeader();

                byte[] bs = stream.ReadBodyBytes();
                System.IO.MemoryStream mstream  = new System.IO.MemoryStream(bs);
                CommonProto.Response   response = ProtoBuf.Serializer.Deserialize <CommonProto.Response>(mstream);

                Debug.Log("responseid = " + response.id + "; " + response.desc);

                if (response.id == 0)
                {
                    LoadingScene.LoadNewScene("demo");
                }
                break;
            }

            default:
            {
                break;
            }
            }
            packet = null;
        }
    }
Beispiel #18
0
 public void Shopping_Menu()
 {
     try {
         LoadingScene.SetActive(true);
         StartCoroutine(loadAsync(1));
     }
     catch (Exception ex) {
     }
 }
 public void Close_Click()
 {
     if (!TownScenesController.isHelp)
     {
         CreatTownScenesController.isDenyContinue = false;
         //Application.LoadLevel(nameScreenPre);
         LoadingScene.ShowLoadingScene(nameScreenPre, true);
     }
 }
Beispiel #20
0
        public void ChangeScene(SceneBase sceneState)
        {
            var sceneNames   = sceneState.GetLoadSceneNames();
            var preLoadPaths = sceneState.GetAssetLoadPaths();
            var transition   = new SceneTransition(sceneNames, preLoadPaths);
            var loading      = new LoadingScene(sceneState, transition);

            stateMachine.SetState(loading);
        }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         //DontDestroyOnLoad(this);
     }
     //  else Destroy(gameObject);
 }
Beispiel #22
0
 public void Stage5Click()
 {
     if (_LoadJsonData.StageButton[5].colors.normalColor == _LoadJsonData.OffNormalColor)
     {
         return;
     }
     LoadingScene.LoadScene("Stage5");
     audiosource.Stop();
 }
Beispiel #23
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag == "Player")
     {
         GameCtrl.instance.currentMap     = 0;
         GameCtrl.instance.currentMapType = StageType.NormalStage;
         LoadingScene.LoadScene("Status");
     }
 }
Beispiel #24
0
 public void Farm_Click()
 {
     if (!Application.loadedLevelName.Equals("Farm"))
     {
         audioControl.PlaySound("Click 1");
         LoadingScene.ShowLoadingScene("Farm", true);
         PanelHouseController.nameScreenPre = "Farm";
     }
 }
Beispiel #25
0
    public static void HideLoadingScene()
    {
        LoadingScene load = GameObject.Find("LoadingScene").GetComponent <LoadingScene>();

        if (load.show)
        {
            load.HideLoading();
        }
    }
Beispiel #26
0
        void Awake()
        {
            backButton.onClick.RemoveAllListeners();
            LoadScene ls = GameObject.Find("Script").GetComponent <LoadScene> ();

            backButton.onClick.AddListener(() => ls.LoadScene_OutNetMenu("MainMenu"));
            LoadingScene ls2 = GameObject.Find("Script").GetComponent <LoadingScene> ();

            backButton.onClick.AddListener(() => ls2.playSoundBack());
        }
Beispiel #27
0
 public void City_Click()
 {
     if (!Application.loadedLevelName.Equals("Town"))
     {
         audioControl.PlaySound("Click 1");
         isLeavedFarm = true;
         LoadingScene.ShowLoadingScene("Town", true);
         PanelHouseController.nameScreenPre = "Town";
     }
 }
Beispiel #28
0
    public void LoadSceneNum(int num)
    {
        if (num < 0 || num >= SceneManager.sceneCountInBuildSettings)
        {
            return;
        }


        LoadingScene.LoadScene(num);
    }
Beispiel #29
0
        /// <summary>
        /// 更新する
        /// </summary>
        /// <param name="inputInfo">入力の情報</param>
        /// <param name="mouseInfo">マウスの情報</param>
        /// <param name="sound">サウンド</param>
        public void Update(InputInfoBase inputInfo, MouseInfo mouseInfo, ISound sound)
        {
            Sound = sound;
            if (previousScene != null)
            {
                previousScene.Dispose();
                if (!previousSceneResourceUsing && !PPDSetting.Setting.AllowedToUseMuchMemory && previousScene.ResourceManager != null)
                {
                    previousScene.ResourceManager.Dispose();
                }
                previousScene = null;
                device.GetModule <CharCacheManager>().ClearUnUsed();
            }
            if (nextScene != null)
            {
                if (LoadFinished)
                {
#if DEBUG
                    Console.WriteLine("LoadTime is:" + (Environment.TickCount - lastTime));
#if BENCHMARK
                    Benchmark.Instance.EndCategory();
#endif
#endif
                    loadingThread.Join();
                    loadingThread = null;
                    device.GetModule <CharCacheManager>().ClearUnUsed();
                    if (loadResult)
                    {
                        CurrentScene = nextScene;
                    }
                    else
                    {
                        previousScene = nextScene;
                        CurrentScene  = sceneStack.Pop();
                        CurrentScene.SceneStackPoped(new Dictionary <string, object>
                        {
                            { "Failed to initialize", "" }
                        });
                    }
                    nextScene = null;
                    if (LeaveLoading != null)
                    {
                        LeaveLoading.Invoke(this, EventArgs.Empty);
                    }
                }
            }
            if (CurrentScene != null)
            {
                CurrentScene.Update(inputInfo, mouseInfo);
            }
            if (loadingThread != null && LoadingScene != null)
            {
                LoadingScene.Update(inputInfo, mouseInfo);
            }
        }
Beispiel #30
0
    private void Awake()
    {
        instance = this;
#if SanWang
        objHealthy.SetActive(true);
        isShowHealthyGameTip = true;
#elif GooglePlay
        objHealthy.SetActive(false);
        isShowHealthyGameTip = false;
#endif
    }
Beispiel #31
0
 public static void AddScene(string key, Scene scene, LoadingScene loadingScene)
 {
 }
Beispiel #32
0
 void Awake()
 {
     Instance = this;
     _mCameraGameObject = transform.Find("Camera").gameObject;
     _mCameraGameObject.SetActive(false);
 }
        IEnumerator WaitForScene(System.Action doneCallback)
        {
            while (loadingScene == null)
            {
                loadingScene = GameObject.FindObjectOfType(typeof(LoadingScene)) as LoadingScene;
                if (loadingScene == null)
                {
                    yield return 0;
                }
            }

            loadingScene.GetComponent<Camera>().enabled = false;
            initialized = true;

            if (doneCallback != null)
            {
                doneCallback();
            }
        }