Ejemplo n.º 1
0
        /// <summary>
        /// 左右入力をチェックするコンポーネント
        /// </summary>
        void KeyCheckHorizontal()
        {
            // 左に移動させる入力を受け付けたかどうかのフラグ
            var isLeft = (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow) ||
                          GamePad.GetButtonDown(GamePad.Button.LeftShoulder, GamePad.Index.Any));
            // 右に移動させる入力を受け付けたかどうかのフラグ
            var isRight = (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow) ||
                           GamePad.GetButtonDown(GamePad.Button.RightShoulder, GamePad.Index.Any));

            // 右への移動と左への移動のどちらか片方だけをうけたなら
            if (isLeft != isRight)
            {
                // 左への移動
                if (isLeft == true)
                {
                    selectScene--;
                }
                // 右への移動
                else if (isRight == true)
                {
                    selectScene++;
                }
                // タイトルとリザルトの間に収める
                selectScene = (SelectScene)Mathf.Clamp((int)selectScene, (int)SelectScene.SelectMenu, (int)SelectScene.Title);
                // 音量を変更
                audioSource.volume = 0.25f;
                // 音源をセット
                audioSource.clip = selectClip;
                // 選択音の再生
                audioSource.Play();
            }
        }
Ejemplo n.º 2
0
    static void Main(string[] args)
    {
        Console.CursorVisible = false;                                   //커서 지우기
        Console.SetWindowSize(126, 63);
        SelectScene select = new SelectScene();

        select.Run();
    }
    /* UNCOMMENT FOR ADDING SCENE TO EXISTING SCENE */
    //
    // Summary:
    //      Preforms the level loading based on the player entering a trigger area

    /*
     * void OnTriggerEnter(Collider other)
     * {
     *  // If the collided object is the player and the box hasn't been triggered before.
     *  if (other.gameObject.name == "Player" && !_HasBeenTriggered)
     *  {
     *      if (UnloadScene)
     *      {
     *          // Asynchronously unloads the selected scene.
     *          SceneManager.UnloadSceneAsync(SelectScene.ToString());
     *      }
     *      else
     *      {
     *          // A switch case. Not needed, but is important to know what it looks like.
     *          // You could just do StartCoroutine(LoadSceneAsync(LoadSceneMode.Additive));
     *          // and ignore the switch case entierly, but if you want to preform any special
     *          // commands based on the selected level, this is how you'd do it.
     *          switch (SelectScene)
     *          {
     *              case SceneSelection.Scene_1:
     *                  //Some unique action based on scene selection
     *                  // Load scene *into* existing scene.
     *                  StartCoroutine(LoadSceneAsync(LoadSceneMode.Additive));
     *                  // a break statement is required at the end of each case statement.
     *                  break;
     *              case SceneSelection.Scene_2:
     *                  //Some unique action based on scene selection
     *                  // Load scene *into* existing scene.
     *                  StartCoroutine(LoadSceneAsync(LoadSceneMode.Additive));
     *                  // a break statement is required at the end of each case statement.
     *                  break;
     *          }
     *      }
     *      // Updates the _HasBeenTriggered value to true, meaning the OnTriggerEnter can not
     *      // be triggered again.
     *      _HasBeenTriggered = true;
     *  }
     * }
     */
    //
    // Summary:
    //      Loads a scene asynconously. It will load a scene only once the scene fully loads.
    //
    // Parameters:
    //   lsm:
    //     The enum value of LoadSceneMode. Either LoadSceneMode.Additive or LoadSceneMode.Single.
    //
    // Returns:
    //     null
    IEnumerator LoadSceneAsync(LoadSceneMode lsm)
    {
        AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(SelectScene.ToString(), lsm);

        // Wait until the asynchronous scene fully loads
        while (!asyncLoad.isDone)
        {
            yield return(null);
        }
    }
Ejemplo n.º 4
0
        public static void NewCharacterSuccess(NewCharacterSuccess P)
        {
            NewCharacterDialog.CharacterNameTextBox.Enabled = true;
            NewCharacterDialog.ConfirmButton.Enabled        = true;
            NewCharacterDialog.Hide();
            SceneFunctions.ShowMessage("Your character was created successfully.");

            SelectScene.CharacterList.Insert(0, P.CharInfo);
            SelectScene.SelectedIndex = 0;
            SelectScene.UpdateSelectButtons();
        }
Ejemplo n.º 5
0
        public static void LogOutSuccess(LogOutSuccess P)
        {
            SceneFunctions.LogOutSuccess();

            if (P.CharacterList != null)
            {
                P.CharacterList.Sort(delegate(SelectCharacterInfo S1, SelectCharacterInfo S2) { return(S2.LastAccess.CompareTo(S1.LastAccess)); });
            }

            SelectScene.CharacterList = P.CharacterList;
            SelectScene.UpdateSelectButtons();
        }
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "Player")
        {
            SceneManager.LoadScene(SelectScene.ToString(), LoadSceneMode.Single);
            // LoadScene.Additive loads the scene onto the active scene
            //SceneManager.LoadScene(SelectScene.ToString(), LoadSceneMode.Additive);

            // An alternative to the basic SceneManager.LoadScene, you can load a scene
            // asynconously, meaning that the scene will only open once it has fully loaded.
            // StartCoroutine(LoadSceneAsync(LoadSceneMode.Single));
        }
    }
Ejemplo n.º 7
0
        public static void DeleteCharacter(DeleteCharacter P)
        {
            switch (P.Result)
            {
            case 0:
                SceneFunctions.ShowMessage("An error occured when trying delete your character.");
                break;

            case 1:
                SceneFunctions.ShowMessage("Deleting characters is currently disabled.");
                break;

            case 2:
                SceneFunctions.ShowMessage("The character you selected does not exist.\n Contact a GM for assistance.");
                break;

            case 3:
                for (int I = 0; I < SelectScene.CharacterList.Count; I++)
                {
                    if (SelectScene.CharacterList[I].Index == SceneFunctions.DeleteIndex)
                    {
                        SelectScene.CharacterList.RemoveAt(I);
                        break;
                    }
                }

                SelectScene.UpdateSelectButtons();
                SceneFunctions.ShowMessage("Your character was deleted successfully.");
                break;

#if DEBUG
            default:
                throw new NotImplementedException();
#endif
            }
        }
Ejemplo n.º 8
0
 // Start is called before the first frame update
 void Start()
 {
     scene_name = SelectScene.Scene();
 }
Ejemplo n.º 9
0
        public void SelectScene(Zone zone, Scene scene, Action <SendResult> OnComplete)
        {
            SelectScene si = new SelectScene(zone, scene);

            SendCommand(si, false, OnComplete);
        }
Ejemplo n.º 10
0
        public void SelectScene(Zone zone, Scene scene)
        {
            SelectScene si = new SelectScene(zone, scene);

            SendCommand(si, true);
        }