Example #1
0
        /// <summary>
        /// パスを指定してファイルを開く
        /// </summary>
        /// <param name="editor">テキストを展開するためのIEditorインターフェース</param>
        /// <param name="filePath">ファイルを開くパス</param>
        /// <returns>正否</returns>
        public bool OpenFile(IEditor editor, String filePath)
        {
            LoadManager manager = new LoadManager(editor);

            if (manager.Load(filePath) == LoadResult.Succeed)
            {
                CurrentFile = filePath;

                string lastSavedFilePath = Properties.Settings.Default.LastSavedFilePath;
                if (lastSavedFilePath != "Default")
                {
                    Properties.Settings.Default.SavedFolderPath   = Path.GetDirectoryName(CurrentFile);
                    Properties.Settings.Default.LastSavedFilePath = CurrentFile;
                    Properties.Settings.Default.Save();
                }
            }
            else
            {
                ShowDialogManager.ShowMessageBox("ファイルを開けませんでした。", "エラー", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            EventAggregator.OnDataReloaded(this, new DataReloadedEventArgs());

            return(true);
        }
Example #2
0
    private void CreateFinished(object obj)
    {
        PlayerData player = new PlayerData();

        player.id                = cellIndex;
        player.name              = inputName.text == "" ? "Player": inputName.text;
        player.open              = true;
        player.nowHealth         = 16;
        player.maxHealth         = 16;
        player.defence           = 0;
        player.shootSpeedPlus    = 1.0f;
        player.powerPlus         = 1;
        player.weapons           = "0";
        player.clearedEnemyGroup = "";
        player.nowLevel          = SceneName.Level1_1;
        player.skin              = dropSkin.value;
        player.antler            = dropAntler.value;
        player.spot              = dropSpot.value;
        player.color             = dropColor.value;
        player.startPosition     = "48#1#22";
        player.hasKey            = "Level1_1";
        player.guideList         = "";
        player.tipList           = "";
        player.ownedItem         = "";
        player.showMapPoint      = false;
        DataManager.Instance.Save(player);
        GameRoot.Instance.SetNowPlayer(cellIndex);
        LoadManager.Load(SceneName.Level1_1);
        GameRoot.Instance.evt.CallEvent(GameEventDefine.INIT_DATA, null);
        GameRoot.Instance.evt.CallEvent(GameEventDefine.GAME_RESUME, null);
    }
Example #3
0
    private void BtnClick(Button button)
    {
        switch (button.name)
        {
        case "btnRestart":
            LoadManager.Load(GameController.Instance.LevelName);
            GameRoot.Instance.evt.CallEvent(GameEventDefine.GAME_RESUME, null);
            break;

        case "btnResume":
            UIManager.Instance.PopPanel();
            GameController.Instance.isPausing = false;
            GameRoot.Instance.evt.CallEvent(GameEventDefine.GAME_RESUME, null);
            break;

        case "btnSetting":
            UIManager.Instance.PushPanel(Panel_ID.SettingPanel);
            break;

        case "btnHome":
            LoadManager.Load(SceneName.StartScene);
            GameRoot.Instance.evt.CallEvent(GameEventDefine.GAME_RESUME, null);
            break;
        }
    }
Example #4
0
 private void GoGame(object obj)
 {
     GameRoot.Instance.SetNowPlayer(cellIndex);
     LoadManager.Load(GameRoot.Instance.GetNowPlayer().nowLevel);
     GameRoot.Instance.evt.CallEvent(GameEventDefine.INIT_DATA, null);
     GameRoot.Instance.evt.CallEvent(GameEventDefine.GAME_RESUME, null);
 }
Example #5
0
        /// <summary>
        /// 打开一个UI界面
        /// </summary>
        public GameObject OpenUI(string uiName, params object[] parameters)
        {
            if (!uiRoot)
            {
                Debug.LogError($"SceneManager 需要初始化属性:uiRoot!");
                return(null);
            }

            var uiGo = LoadManager.Load <GameObject>(GetUIPathName(uiName));

            uiGo = Instantiate(uiGo, uiRoot, true);
            uiGo.transform.Reset();
            var rectTrans = uiGo.transform as RectTransform;

            rectTrans.offsetMax = Vector2.zero;
            rectTrans.offsetMin = Vector2.zero;
            uiGo.SetActive(true);
            var ui = uiGo.GetComponent <UI>();

            if (ui)
            {
                ui.InitParams(parameters);
            }

            Record(uiName, uiGo);

            return(uiGo);
        }
Example #6
0
 void Update()
 {
     if (Input.anyKey)
     {
         loadManager.Load("Dungeon");
     }
 }
Example #7
0
    // Update is called once per frame
    void Update()
    {
        // Add players when they press fire button
        if (Input.GetAxisRaw("Jump_P1") > 0)
        {
            PlayerManager.AddPlayer(1);
            Player1.SetActive(true);
        }

        if (Input.GetAxisRaw("Jump_P2") > 0)
        {
            PlayerManager.AddPlayer(2);
            Player2.SetActive(true);
        }

        if (Input.GetAxisRaw("Jump_P3") > 0)
        {
            PlayerManager.AddPlayer(3);
            Player3.SetActive(true);
        }

        if (Input.GetAxisRaw("Jump_P4") > 0)
        {
            PlayerManager.AddPlayer(4);
            Player4.SetActive(true);
        }

        if (Input.GetButtonDown("Submit_P1") || Input.GetButtonDown("Submit_P2") || Input.GetButtonDown("Submit_P3") || Input.GetButtonDown("Submit_P4"))
        {
            LoadManager.Load(LoadManager.Scenes.LevelSelectMenu);
        }
    }
Example #8
0
    public void To_Ingame()
    {
        Destroy(Bgm);
        SoundManager.Instance.PlayBGM();

        SoundManager.Instance.PlaySound("Prize_Wheel_Spin_2_Reward");
        LoadManager.LoaderCallback();
        LoadManager.Load(LoadManager.Scene.Ingame);
    }
Example #9
0
    void Awake()
    {
        inventory = TagResolver.i.inventory;
        PlayerData pd = LoadManager.Load();

        if (pd != null)
        {
            Player player = TagResolver.i.player;
            player.transform.position = LoadManager.GetPlayerPosition();
            player.transform.rotation = Quaternion.Euler(0, pd.playerRotationY, 0);
        }
    }
Example #10
0
    private void BtnClick(Button button)
    {
        switch (button.name)
        {
        case "btnSetting":
            break;

        case "btnHome":
            LoadManager.Load(SceneName.StartScene);
            GameRoot.Instance.evt.CallEvent(GameEventDefine.GAME_RESUME, null);
            break;
        }
    }
    //--------------------------------------------

    void selectSlot(int slot)
    {
        if (File.Exists(Application.persistentDataPath + "/saveslot" + (slot + 1) + ".data"))
        {
            gameMaster.setGameMode(1);
            LoadManager.Load(slot + 1);
            mainMenu.SetActive(false);
        }
        else
        {
            Debug.Log("slot " + (slot + 1) + " is empty!");
        }
    }
Example #12
0
    public void To_Ingame()
    {
        TutorialObj.SetActive(false);

        SoundManager.Instance.PlaySound("Prize_Wheel_Spin_2_Reward");
        Backend.Chart.GetAllChartAndSave(true);

        ScenarioData.Instance.SetScenarioData();
        ActorData.Instance.SetActorsData();
        MarketingData.Instance.SetMarketingData();

        GameManager.Instance.LoadData();

        LoadManager.LoaderCallback();
        LoadManager.Load(LoadManager.Scene.Ingame);
    }
Example #13
0
    public void Try_Login_WithToken()
    {
        Popup_Loading.SetActive(true);
        var Login = Backend.BMember.LoginWithTheBackendToken();

        Popup_Loading.SetActive(false);

        switch (Login.GetStatusCode())
        {
        case "201":
            SoundManager.Instance.PlaySound("Prize_Wheel_Spin_2_Reward");
            GameManager.Instance.Init();

            //GameManager.Instance.Tutorial = true;
            //TutorialObj.SetActive(true);

            LoadManager.Load(LoadManager.Scene.Ingame);
            break;

        case "401":
            Popup_Black.SetActive(true);
            Popup_Login.SetActive(true);
            //Debug.LogError("다른 기기에서 로그인하여 토큰이 사라짐");
            //Error_Message = "다른 기기에서 로그인하여 토큰이 사라짐";
            //Control_Error(true);
            break;

        case "400":
            Popup_Black.SetActive(true);
            Popup_Login.SetActive(true);
            //Debug.LogError("토큰 없음");
            //Error_Message = "토큰 없음";
            //Control_Error(true);
            break;

        case "403":
            Error_Message = Login.GetErrorCode();
            Control_Error(true);
            break;

        default:
            Error_Message = ERROR_MESSAGE.LOGIN_UNKNOWN;
            Control_Error(true);
            break;
        }
    }
Example #14
0
    public void SignUp_NickName()
    {
        Popup_Loading.SetActive(true);

        var Nickname = Backend.BMember.UpdateNickname(Nickname_Nickname.text);

        Popup_Loading.SetActive(false);

        Debug.Log(Nickname);

        switch (Nickname.GetStatusCode())
        {
        case "204":
            SoundManager.Instance.PlaySound("Prize_Wheel_Spin_2_Reward");
            GameManager.Instance.Init();

            //GameManager.Instance.Tutorial = true;
            //TutorialObj.SetActive(true);
            LoadManager.Load(LoadManager.Scene.Ingame);
            break;

        case "400":
            switch (Nickname.GetErrorCode())
            {
            case "UndefinedParameterException":
                Error_Message = ERROR_MESSAGE.SETNICK_EMPTY;
                Control_Error(true);
                break;

            case "BadParameterException":
                Error_Message = ERROR_MESSAGE.SETNICK_BAD;
                Control_Error(true);
                break;
            }
            break;

        case "409":
            Error_Message = ERROR_MESSAGE.SETNICK_DUPLICATE;
            Control_Error(true);
            break;
        }
    }
Example #15
0
    public void To_Ingame()
    {
        Destroy(Bgm);
        SoundManager.Instance.PlayBGM();

        if (GameManager.Instance.OnPackage == true && GameManager.Instance.UsePackage == true)
        {
            GameManager.Instance.UsedStartPackage();
        }

        GameManager.Instance.CostMoney(ResultMoney, false);
        if (GameManager.Instance.Money < 0) //파산
        {
            GameManager.Instance.Is_Bankrupt(true);
        }


        GameManager.Instance.Reset();
        LoadManager.Load(LoadManager.Scene.Ingame);
    }
    //---------------------------------------------------------------------------------

    public void Update()
    {
        rb.velocity = new Vector2(moveSpeed * velocity * Time.deltaTime * 60, rb.velocity.y);

        if (keyboard.f1Key.wasPressedThisFrame)
        {
            SaveSystem.SavePlayer(GetComponent <Transform>(), 1, GetComponent <PowerupSlot>().powerupSlot);
        }

        if (keyboard.f2Key.wasPressedThisFrame)
        {
            LoadManager.Load(1);
        }

        animator.SetFloat("speed", Mathf.Abs(rb.velocity.x));

        /* (canClimb)
         *   rb.velocity = new Vector2(0, 0);
         */
    }
Example #17
0
 public void GoAgain()
 {
     ScoreManager.Initialize();
     LoadManager.Load(LoadManager.LastLoadedLevel);
     isShowing = false;
 }
Example #18
0
 public void LevelSelect()
 {
     ScoreManager.Initialize();
     LoadManager.Load(LoadManager.Scenes.LevelSelectMenu);
 }
Example #19
0
 public void Quit()
 {
     ScoreManager.Initialize();
     LoadManager.Load(LoadManager.Scenes.MainMenu);
 }
Example #20
0
 public void LoadLevel()
 {
     LoadManager.Load(levelName);
 }
Example #21
0
 public void GoAgain()
 {
     ScoreManager.Initialize();
     LoadManager.Load(LoadManager.LastLoadedLevel);
 }
Example #22
0
    public void GPGSLogin()
    {
        Popup_Loading.SetActive(true);

        // 이미 로그인 된 경우
        if (Social.localUser.authenticated == true)
        {
            //BackendReturnObject BRO = Backend.BMember.AuthorizeFederation(GetTokens(), FederationType.Google, "gpgs");
            Backend.BMember.AuthorizeFederation(GetTokens(), FederationType.Google, "gpgs", callback =>
            {
                if (callback.IsSuccess())
                {
                    SoundManager.Instance.PlaySound("Prize_Wheel_Spin_2_Reward");

                    Popup_Loading.SetActive(false);

                    switch (callback.GetStatusCode())
                    {
                    case "200":
                    case "201":
                        GameManager.Instance.Init();
                        LoadManager.Load(LoadManager.Scene.Ingame);
                        break;

                    case "403":
                        SoundManager.Instance.PlaySound("Pop_6");
                        Error_Message = callback.GetErrorCode();
                        Control_Error(true);
                        break;

                    default:
                        Error_Message = ERROR_MESSAGE.LOGIN_UNKNOWN;
                        Control_Error(true);
                        break;
                    }
                }
            });
        }
        else
        {
            Social.localUser.Authenticate((bool success) =>
            {
                if (success)
                {
                    // 로그인 성공 -> 뒤끝 서버에 획득한 구글 토큰으로 가입요청
                    //BackendReturnObject BRO = Backend.BMember.AuthorizeFederation(GetTokens(), FederationType.Google, "gpgs");
                    Backend.BMember.AuthorizeFederation(GetTokens(), FederationType.Google, "gpgs", callback =>
                    {
                        if (callback.IsSuccess())
                        {
                            SoundManager.Instance.PlaySound("Prize_Wheel_Spin_2_Reward");

                            Popup_Loading.SetActive(false);

                            switch (callback.GetStatusCode())
                            {
                            case "200":
                            case "201":
                                GameManager.Instance.Init();
                                LoadManager.Load(LoadManager.Scene.Ingame);
                                break;

                            case "403":
                                SoundManager.Instance.PlaySound("Pop_6");
                                Error_Message = callback.GetErrorCode();
                                Control_Error(true);
                                break;

                            default:
                                Error_Message = ERROR_MESSAGE.LOGIN_UNKNOWN;
                                Control_Error(true);
                                break;
                            }
                        }
                    });
                }
                else
                {
                    // 로그인 실패
                    Debug.Log("Login failed for some reason");
                    Error_Message = ERROR_MESSAGE.LOGIN_INTERNETFAIL;
                    Control_Error(true);
                }
            });
        }
    }
Example #23
0
    //---------------------------------------------------------------------

    void Select(int ID, int pos, bool goBack)
    {
        GameObject.FindObjectOfType <AudioManager>().play("Select");

        switch (ID)
        {
        //------------------MAIN MENU----------------------

        case 0:
        {
            if (!goBack)
            {
                switch (pos)
                {
                case 0:
                {
                    changeMenu(MenuList.play);
                    break;
                }

                case 1:
                {
                    changeMenu(MenuList.settings);
                    break;
                }

                case 2:
                {
                    Application.Quit();
                    break;
                }
                }
            }
            break;
        }

        //-----------------CAMPAIGN SELECT--------------------

        case 1:
        {
            if (goBack)
            {
                changeMenu(MenuList.play);
            }
            else
            {
                switch (pos)
                {
                case 0:
                {
                    changeMenu(MenuList.saveSelect);
                    break;
                }

                case 1:
                {
                    gameMaster.setGameMode(1);
                    GetComponentsInParent <Transform>()[1].gameObject.SetActive(false);
                    GameMaster.currentRoom = GameObject.Find("R1");
                    break;
                }
                }
            }
            break;
        }

        //-------------------SAVE SELECT----------------------

        case 2:
        {
            if (goBack)
            {
                changeMenu(MenuList.campaignSelect);
            }
            break;
        }

        //-------------------PAUSE MENU----------------------

        case 3:
        {
            if (goBack)
            {
                transform.parent.gameObject.SetActive(false);
                GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterMovement>().OnEnable();
                Time.timeScale = 1f;
                return;
            }

            switch (pos)
            {
            case 0:
            {
                transform.parent.gameObject.SetActive(false);
                GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterMovement>().OnEnable();
                Time.timeScale = 1f;
                return;
            }

            case 1:
            {
                changeMenu(MenuList.pauseSettings);
                return;
            }

            case 2:
            {
                gameMaster.setGameMode(0);
                transform.parent.gameObject.SetActive(false);
                return;
            }
            }

            break;
        }

        //-------------------AUTOSAVE SLOT----------------------

        case 4:
        {
            Transform player = GameObject.FindGameObjectWithTag("Player").transform;

            if (goBack)
            {
                player.GetComponent <CharacterMovement>().OnEnable();
                Time.timeScale = 1;
                transform.parent.gameObject.SetActive(false);
                return;
            }

            LoadManager.currentSlot = pos + 1;
            if (pos != 3)
            {
                SaveSystem.SavePlayer(player, pos + 1, player.GetComponent <PowerupSlot>().powerupSlot);
            }

            player.GetComponent <CharacterMovement>().OnEnable();
            Time.timeScale = 1;
            changeMenu(MenuList.pauseMenu);
            transform.parent.gameObject.SetActive(false);
            return;
        }

        //-------------------PLAY----------------------

        case 5:
        {
            if (goBack)
            {
                changeMenu(MenuList.mainMenu);
                return;
            }

            switch (pos)
            {
            case 0:
            {
                changeMenu(MenuList.campaignSelect);
                return;
            }

            default:
            {
                gameMaster.setGameMode(pos + 1);
                transform.parent.gameObject.SetActive(false);
                return;
            }
            }
        }

        //-------------------SETTINGS----------------------

        case 6:
        {
            if (goBack)
            {
                changeMenu(MenuList.mainMenu);
                return;
            }
            break;
        }

        //------------------PAUSE SETTINGS----------------------

        case 7:
        {
            if (goBack)
            {
                changeMenu(MenuList.pauseMenu);
                return;
            }
            break;
        }

        //------------------GAME OVER--------------------

        case 8:
        {
            switch (pos)
            {
            case 0:
            {
                LoadManager.Load(LoadManager.currentSlot);
                Time.timeScale = 1;
                GameObject.FindObjectOfType <CharacterMovement>().OnEnable();
                transform.parent.gameObject.SetActive(false);
                return;
            }

            case 1:
            {
                gameMaster.setGameMode(0);
                transform.parent.gameObject.SetActive(false);
                return;
            }
            }
            break;
        }
        }
    }
Example #24
0
    public void Try_Login()
    {
        Popup_Loading.SetActive(true);
        Backend.BMember.CustomLogin(Login_ID.text, Login_Password.text, callback =>
        {
            Debug.Log(callback);

            Popup_Loading.SetActive(false);

            switch (callback.GetStatusCode())
            {
            case "200":
                GameManager.Instance.Init();
                SoundManager.Instance.PlaySound("Prize_Wheel_Spin_2_Reward");
                //GameManager.Instance.Tutorial = true;
                //TutorialObj.SetActive(true);
                LoadManager.Load(LoadManager.Scene.Ingame);
                break;

            case "400":
                SoundManager.Instance.PlaySound("Pop_6");
                Error_Message = ERROR_MESSAGE.LOGIN_EMPTY;
                Control_Error(true);
                break;

            case "401":
                SoundManager.Instance.PlaySound("Pop_6");
                Error_Message = ERROR_MESSAGE.LOGIN_DUPLICATE;
                Control_Error(true);
                break;

            case "403":
                SoundManager.Instance.PlaySound("Pop_6");
                Error_Message = callback.GetErrorCode();
                Control_Error(true);
                break;

            default:
                SoundManager.Instance.PlaySound("Pop_6");
                Error_Message = ERROR_MESSAGE.LOGIN_UNKNOWN;
                Control_Error(true);
                break;
            }
        });

        //var Login = Backend.BMember.CustomLogin(Login_ID.text, Login_Password.text);
        //Debug.Log(Login);
        //Popup_Loading.SetActive(false);
        //
        //switch (Login.GetStatusCode())
        //{
        //    case "200":
        //        SetDataInit();
        //        LoadManager.Load(LoadManager.Scene.Ingame);
        //        break;
        //    case "400":
        //        Error_Message = ERROR_MESSAGE.LOGIN_EMPTY;
        //        Control_Error(true);
        //        break;
        //    case "401":
        //        Error_Message = ERROR_MESSAGE.LOGIN_DUPLICATE;
        //        Control_Error(true);
        //        break;
        //    case "403":
        //        Error_Message = Login.GetErrorCode();
        //        Control_Error(true);
        //        break;
        //    default:
        //        Error_Message = ERROR_MESSAGE.LOGIN_UNKNOWN;
        //        Control_Error(true);
        //        break;
        //}
    }
Example #25
0
 AudioClip LoadSound(string resourcesPath)
 {
     return(LoadManager.Load <AudioClip>(resourcesPath));
 }
Example #26
0
 public void To_Ingame()
 {
     SoundManager.Instance.PlaySound("Pop_6");
     LoadManager.LoaderCallback();
     LoadManager.Load(LoadManager.Scene.Ingame);
 }
Example #27
0
 public void Quit()
 {
     ScoreManager.Initialize();
     LoadManager.Load(LoadManager.Scenes.MainMenu);
     isShowing = false;
 }
Example #28
0
 public void PlayGame()
 {
     LoadManager.Load(LoadManager.Scenes.PlayerSelectMenu);
 }