예제 #1
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 public NoteData(int eventTime, GameInputType inputType, int laneIndex, int pressRate)
 {
     EventTime = eventTime;
     InputType = inputType;
     LaneIndex = laneIndex;
     PressRate = pressRate;
 }
예제 #2
0
 public void SaveAndExit(GameStateType state, GameInputType input)
 {
     LoadingScreen.SetActive(true);
     PlayerCamera.SetActive(false);
     PlayerPersistenceManager.SavePlayer(World.PlayerManager);
     WorldPersistenceManager.SaveWorld(World);
     World.Sleep();
     TakeInput(GameInputType.WorldUnloaded);
 }
예제 #3
0
    public bool GetStay(GameInputType type)
    {
        bool isStay = false;

        for (int i = 0; i < _inputDevices.Count; i++)
        {
            isStay = _inputDevices[i].GetUp((inputTypes[(int)type]));
        }
        return(isStay);
    }
예제 #4
0
    public bool GetDown(GameInputType type)
    {
        bool isDown = false;

        for (int i = 0; i < _inputDevices.Count; i++)
        {
            isDown = _inputDevices[i].GetDown((inputTypes[(int)type]));
        }
        return(isDown);
    }
예제 #5
0
파일: InputManager.cs 프로젝트: tsuixl/act
        /// <summary>
        /// 根据类型获取一个输入状态
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>

        public InputStateBase GetKeycodeState(GameInputType type)
        {
            for (int i = 0; i < _mInputStatesBase.Length; i++)
            {
                if (_mInputStatesBase[i].InputType == type)
                {
                    return(_mInputStatesBase[i]);
                }
            }
            return(null);
        }
예제 #6
0
        public void LoadWorld(GameStateType previousState, GameInputType input)
        {
            HUD.SetActive(true);
            LoadingScreen.SetActive(true);
            PlayerManager playerManager = PlayerMenu.GetComponent <PlayerMenuController>().SelectedPlayer;

            World = WorldMenu.GetComponent <WorldMenuController>().SelectedWorld;
            World.Setup(playerManager);
            World.SpawnPlayer();
            PlayerCamera.SetActive(true);
            Time.timeScale = 1;
        }
예제 #7
0
        /// <summary>
        /// 根据类型创建KeyState实例
        /// </summary>
        /// <param name="type"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        public static InputStateBase CreateStateByType(GameInputType type, KeyCode code)
        {
            switch (type)
            {
                case GameInputType.Jump:
                case GameInputType.Attack:
                case GameInputType.SkillAttack:
                    return new InputKeyState(code) { InputType = type };
                case GameInputType.Move:
                    return new InputMoveState() { InputType = GameInputType.Move };
            }

            throw new System.Exception(string.Format("Can't Find Type [{0}]", type.ToString()));
        }
예제 #8
0
        /// <summary>
        /// 根据类型创建KeyState实例
        /// </summary>
        /// <param name="type"></param>
        /// <param name="code"></param>
        /// <returns></returns>

        public static InputStateBase CreateStateByType(GameInputType type, KeyCode code)
        {
            switch (type)
            {
            case GameInputType.Jump:
            case GameInputType.Attack:
            case GameInputType.SkillAttack:
                return(new InputKeyState(code)
                {
                    InputType = type
                });

            case GameInputType.Move:
                return(new InputMoveState()
                {
                    InputType = GameInputType.Move
                });
            }

            throw new System.Exception(string.Format("Can't Find Type [{0}]", type.ToString()));
        }
예제 #9
0
 public InputCondition(InputState state, GameInputType code)
 {
     _inputState = state;
     _inputCode = code;
 }
예제 #10
0
파일: InputManager.cs 프로젝트: tsuixl/act
        /// <summary>
        /// 获取一个InputKeyState实例
        /// </summary>
        /// <param name="type">类型</param>
        /// <param name="stateBase">返回</param>
        /// <returns></returns>

        public bool TryGetKeycodeState(GameInputType type, out InputStateBase stateBase)
        {
            stateBase = GetKeycodeState(type);
            return(stateBase != null);
        }
예제 #11
0
 // Function to change the Gametype. This must be called by the new gamemode to deactivate old input-behaviour and activate current input-behaviour.
 public void ChangeGIT(GameInputType targetType)
 {
     ResetFunctions();
     this._currentGIT = targetType;
     SetFunctions();
 }
예제 #12
0
 public InputCondition(InputState state, GameInputType code)
 {
     _inputState = state;
     _inputCode  = code;
 }
예제 #13
0
 public void OnPlayerDeath(GameStateType previousState, GameInputType inputType)
 {
     Time.timeScale = 1f;
     DeathScreen.SetActive(true);
     StartCoroutine("FadeToBlack");
 }
예제 #14
0
 public void TakeInput(GameInputType inputType)
 {
     StateMachine.TakeInput(inputType);
 }
예제 #15
0
 public InputSubscribeAttribute(GameInputType type)
 {
     InputType = type;
 }
예제 #16
0
 /// <summary>
 /// Subscribes a delegate to a specific input event type!
 /// This can only be called if BeginSubscriptionStack has been called
 /// prior and if the delegate belongs to the registered object.
 /// </summary>
 /// <param name="inputType">The input type</param>
 /// <param name="value">The delegate method to call</param>
 public void Subscribe(GameInputType inputType, Delegate value)
 {
     Assert.IsNotNull(this._currentInputStack, "Calling Subscribe without ever calling Begin!");
     this._currentInputStack.Delegates.Add(inputType, value);
 }