Exemple #1
0
    private void UIActive()
    {
        if (SwitchInput.GetButtonDown(0, SwitchButton.Ok) && Flg && !START && !EXIT && !Credit)
        {
            switch (select_index)
            {
            case 0:
                Credit = true;
                Credit_Image.SetActive(true);
                //音再生
                SoundManager.Instance.Push();
                break;

            case 1:
                START = true;
                //ロードする時の処理
                StartCoroutine("Loadscene");
                //音再生
                SoundManager.Instance.Push();
                break;

            case 2:
                EXIT = true;
                StartCoroutine("End");
                //音再生
                SoundManager.Instance.Push();
                break;
            }
        }
    }
Exemple #2
0
 void Update()
 {
     if (SwitchInput.GetButtonDown(0, SwitchButton.Down))
     {
         SceneManager.LoadScene("SelectScene");
     }
 }
Exemple #3
0
    void Update()
    {
        if (stagenumber != UiRectTransforms.Length - 1)
        {
            //後ろのマップを回転させる
            list[stagenumber].transform.Rotate(0, 5.0f * Time.deltaTime, 0);
        }

        if (Push)
        {
            return;
        }
        if (!Fade.Instance.IsEnd)
        {
            return;
        }
        SelectUpdate();

        //決定
        if (SwitchInput.GetButtonDown(0, SwitchButton.Ok) && !Push)
        {
            Push = true;
            //プッシュの音を鳴らす
            SoundManager.Instance.Push();
            //ロード処理に入る
            StartCoroutine("Loadscene");
        }
    }
Exemple #4
0
        /// <summary>
        /// ブーストの更新
        /// </summary>
        void UpdateBoost()
        {
            //ブースト
            boostIntervalTimeCount -= Time.deltaTime;
            if (boostIntervalTimeCount <= 0.0f)
            {
                if (!particleSystem.isPlaying)
                {
                    particleSystem.Play();
                }
            }
            else
            {
                if (!particleSystem.isStopped)
                {
                    particleSystem.Stop();
                }
            }

            if ((SwitchAcceleration.GetAcceleration(ballBehaviour.playerIndex).magnitude > 3.0f ||
                 SwitchInput.GetButtonDown(ballBehaviour.playerIndex, SwitchButton.Boost)) &&
                boostIntervalTimeCount <= 0.0f)
            {
                //入力方向に力を加える
                ballBehaviour.thisRigidbody.AddForce(
                    ballBehaviour.lookatDir.normalized *
                    ballBehaviour.boostPower *
                    ballBehaviour.thisRigidbody.mass);

                boostIntervalTimeCount = ballBehaviour.boostInterval;
            }
        }
    private void Update()
    {
        if (fade.IsFade)
        {
            return;
        }
        RenderSettings.skybox = skybox;
        if (!titleAnimationPlaying)
        {
            if (SwitchInput.GetButtonDown(0,
                                          nn.hid.NpadButton.A |
                                          nn.hid.NpadButton.B |
                                          nn.hid.NpadButton.X |
                                          nn.hid.NpadButton.Y |
                                          nn.hid.NpadButton.Up |
                                          nn.hid.NpadButton.Down |
                                          nn.hid.NpadButton.Right |
                                          nn.hid.NpadButton.Left))
            {
                SeManager.GetInstance().Play(SeEnum.Decision);
                fade.StartFadeOut("CharacterSelectScene");
            }
        }

        if (canSkip)
        {
            if (SwitchInput.GetButtonDown(0, SwitchButton.Pause))
            {
                titleAnimator.SetTrigger("SkipTrigger");
            }
        }
    }
Exemple #6
0
        /// <summary>
        /// 移動
        /// </summary>
        void Move()
        {
            //入力を受け付けない
            if (ballBehaviour.cantInputTime > 0.0f)
            {
                ballBehaviour.cantInputTime -= Time.deltaTime;
                return;
            }

            var stickInput = SwitchInput.GetStick(ballBehaviour.playerIndex);

            Vector3 addPower = new Vector3(stickInput.x, 0, stickInput.y);

            //力を加える
            AddForceAndTorque(addPower);
            //向きを更新
            ballBehaviour.UpdateLookatDirection(addPower);
            //アニメーションの更新
            if (stickInput.sqrMagnitude == 0)
            {
                ballBehaviour.playerAnimationController.AnimationSwitch(PlayerAnimationController.AnimationType.Idle);
            }
            else
            {
                if (stickInput.magnitude > 0.9f)
                {
                    ballBehaviour.playerAnimationController.AnimationSwitch(PlayerAnimationController.AnimationType.Run);
                }
                else
                {
                    ballBehaviour.playerAnimationController.AnimationSwitch(PlayerAnimationController.AnimationType.Walk);
                }
            }
            ballBehaviour.PlayerRotation(ballBehaviour.lookatDir);
        }
Exemple #7
0
 void Update()
 {
     if (SwitchInput.GetButtonDown(0, SwitchButton.Down))
     {
         SceneManager.LoadScene("PlayerNumCheckScene");
     }
 }
Exemple #8
0
        public SwitchNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA)
        {
            Name = "Switch";
            Id   = Guid.NewGuid().ToString();

            width  = w;
            height = h;

            selected = SwitchInput.Input0;

            tileX = tileY = 1;

            internalPixelType = p;

            previewProcessor = new BasicImageRenderer();

            input  = new NodeInput(NodeType.Gray | NodeType.Color, this, "Input 0");
            input2 = new NodeInput(NodeType.Gray | NodeType.Color, this, "Input 1");
            Output = new NodeOutput(NodeType.Color | NodeType.Gray, this);

            input.OnInputAdded   += Input_OnInputAdded;
            input.OnInputRemoved += Input_OnInputRemoved;
            input.OnInputChanged += Input_OnInputChanged;

            input2.OnInputAdded   += Input_OnInputAdded;
            input2.OnInputRemoved += Input_OnInputRemoved;
            input2.OnInputChanged += Input_OnInputChanged;

            Inputs = new List <NodeInput>();
            Inputs.Add(input);
            Inputs.Add(input2);

            Outputs = new List <NodeOutput>();
            Outputs.Add(Output);
        }
Exemple #9
0
 /// <summary>
 /// スティックでY軸の視点移動
 /// </summary>
 static public void StickY(Transform playerTransform)
 {
     rotateStick = SwitchInput.GetHorizontal(0);
     playerTransform.Rotate(0,
                            rotateStick * ViewpointMovementConfig.GetInstance().GetRotationSpeed() * Time.deltaTime,
                            0);
 }
Exemple #10
0
        public override void FromJson(string data)
        {
            NormalData d = JsonConvert.DeserializeObject <NormalData>(data);

            SetBaseNodeDate(d);
            selected = (SwitchInput)d.selected;
        }
Exemple #11
0
    void Update()
    {
        for (int i = 0; i < m_PlayerNumber; ++i)
        {
            //既にOKならcontinue
            if (m_IsOk[i])
            {
                continue;
            }
            if (SwitchInput.GetButtonDown(i, SwitchButton.Ok))
            {
                SetOk(i);
            }
        }

        //全てOKか確認する
        try
        {
            foreach (var isOk in m_IsOk)
            {
                if (!isOk)
                {
                    throw new Exception();
                }
            }
            //全てOKならシーン遷移
            SceneManager.LoadScene("GameScene");
        }
        catch (Exception) { }
    }
Exemple #12
0
    void Update()
    {
        if (Push)
        {
            return;
        }
        if (!Fade.Instance.IsEnd)
        {
            return;
        }
        SelectUpdate();
        if (SwitchInput.GetButtonDown(0, SwitchButton.Ok) && !Push)
        {
            Push = true;
            string SceneName = "";
            switch (select_index)
            {
            case 0:
                SceneName = "Field";
                break;

            case 1:
                SceneName = "Select";
                break;

            case 2:
                SceneName = "Title";
                break;
            }
            //フェード開始
            StartCoroutine("Loadscene", SceneName);
            //プッシュの音を鳴らす
            SoundManager.Instance.Push();
        }
    }
Exemple #13
0
    /// <summary>
    /// 移動処理
    /// </summary>
    void Movement()
    {
        float horizontal = SwitchInput.GetHorizontal(m_ThisPlayerNumber);
        float vertical   = SwitchInput.GetVertical(m_ThisPlayerNumber);

        //移動量の加算
        m_MoveValue += new Vector2(horizontal, vertical);
    }
Exemple #14
0
    /// <summary>
    /// 移動処理
    /// </summary>
    void Move()
    {
        float vertical   = SwitchInput.GetVertical(0);
        float horizontal = SwitchInput.GetHorizontal(0);

        rigidbody.MovePosition(transform.position +
                               (transform.forward * vertical + transform.right * horizontal) * moveSpeed * Time.deltaTime);
    }
Exemple #15
0
 void CreditUpdate()
 {
     if (SwitchInput.GetButtonDown(0, SwitchButton.Ok) || SwitchInput.GetButtonDown(0, SwitchButton.Cancel))
     {
         Credit = false;
         Credit_Image.SetActive(false);
     }
 }
 void Update()
 {
     FlashLightRotation();
     //Stick押し込みでリセット
     if (SwitchInput.GetButtonDown(0, SwitchButton.Stick))
     {
         SwitchGyro.SetBaseGyro(0);
     }
 }
Exemple #17
0
 public override void MyUpdate()
 {
     for (int i = 0; i < m_NpadIds.Length; ++i)
     {
         //接続状態の更新
         ConnectUpdate(i);
         //入力情報の更新
         SwitchInput.InputUpdate(i, m_NpadIds[i]);
     }
 }
 /// <summary>
 /// ジャンプ
 /// </summary>
 void Jump()
 {
     //ジャンプボタンを押し、地面についているときにジャンプする
     if (SwitchInput.GetButtonDown(playerNumber, SwitchButton.Jump) && IsGround())
     {
         var velocity = rigidbody.velocity;
         velocity.y         = 0.0f;
         rigidbody.velocity = velocity;
         rigidbody.AddForce(Vector3.up * jumpPower, ForceMode.Impulse);
     }
 }
 /// <summary>
 /// 決定のキャンセル
 /// </summary>
 void Cancel(int playerId)
 {
     if (SwitchInput.GetButtonDown(playerId, SwitchButton.Cancel))
     {
         PlayerType type = playerUI[playerId].decisionInfo.decisionInfoType;
         animalArray[animalIndex[type]].GetComponent <BoxCollider>().enabled = true;
         animalArray[animalIndex[type]].transform.localPosition = startAnimal[animalIndex[type]];
         playerUI[playerId].Cancel();
         PlayerJoinManager.SetJoinInfo(playerId, false);
     }
 }
 public override void MyUpdate()
 {
     for (int i = 0; i < npadIds.Length; ++i)
     {
         //接続状態の更新
         ConnectUpdate(i);
         //入力情報の更新
         SwitchInput.InputUpdate(i, npadIds[i]);
         SwitchAcceleration.AccelerationUpdate(i, npadIds[i]);
     }
 }
 void Update()
 {
     if (!animEnd || fade.IsFade)
     {
         return;
     }
     if (SwitchInput.GetButtonDown(0, SwitchButton.Ok) || Input.GetKeyDown(KeyCode.Return))
     {
         fade.StartFadeOut("TitleScene");
     }
 }
Exemple #22
0
 public void Dispose()
 {
     PickedColor?.Dispose();
     EntryInput?.Dispose();
     SliderInput?.Dispose();
     SwitchInput?.Dispose();
     DatePickerInput?.Dispose();
     TimePickerInput?.Dispose();
     StepperInput?.Dispose();
     SubmitCommand?.Dispose();
     _submitDisposable?.Dispose();
 }
Exemple #23
0
 public override void MyStart()
 {
     //コントローラーの初期化
     Npad.Initialize();
     //サポートするタイプをセット
     Npad.SetSupportedIdType(m_NpadIds);
     //サポートするスタイルをセット
     Npad.SetSupportedStyleSet(m_NpadStyles);
     //配列の要素確保
     m_IsConnect = new bool[m_NpadIds.Length];
     //入力の初期化
     SwitchInput.InputInit(m_NpadIds.Length);
 }
Exemple #24
0
 /// <summary>
 /// 回転処理
 /// </summary>
 void ArmRotation()
 {
     //Rなら開く
     if (SwitchInput.GetButton(m_PlayerNumber, SwitchButton.SR))
     {
         m_RotationValue += m_RotationSpeed * Time.deltaTime;
     }
     //Lなら閉じる
     if (SwitchInput.GetButton(m_PlayerNumber, SwitchButton.SL))
     {
         m_RotationValue -= m_RotationSpeed * Time.deltaTime;
     }
 }
        public async Task <Switch> Update(Guid switchId, SwitchInput @switch)
        {
            var entity = await this.Entity(switchId);

            if (entity != null)
            {
                mapper.Map(@switch, entity);
                await switchRepo.Set(entity);
                await SaveChanges();

                return(mapper.Map <Switch>(entity));
            }
            throw new KeyNotFoundException($"Cannot find @switch {switchId.ToString()}");
        }
Exemple #26
0
    void SelectUpdate()
    {
        Vector2Int prev_index = select_index;

        if (SwitchInput.GetButtonDown(0, SwitchButton.StickRight))
        {
            ++select_index.x;
        }
        else if (SwitchInput.GetButtonDown(0, SwitchButton.StickLeft))
        {
            --select_index.x;
        }
        if (SwitchInput.GetButtonDown(0, SwitchButton.StickDown))
        {
            ++select_index.y;
        }
        else if (SwitchInput.GetButtonDown(0, SwitchButton.StickUp))
        {
            --select_index.y;
        }
        select_index.y = Mathf.Clamp(select_index.y, 0, 2);
        select_index.x = Mathf.Clamp(select_index.x, 0, 2);
        if (select_index.y == 2)
        {
            select_index.x = 0;
        }
        if (select_index.y == 1 && prev_index.y == 2)
        {
            select_index.x = 1;
        }
        if (prev_index != select_index)
        {
            UiRectTransforms[stagenumber].localScale = init_scale;
            if (stagenumber != UiRectTransforms.Length - 1)
            {
                list[stagenumber].SetActive(false);
            }
            SoundManager.Instance.Stick();
            increment_scale.Set(0, 0, 0);
            scale_time  = 0.0f;
            stagenumber = select_index.y * 3 + select_index.x;
            if (stagenumber != UiRectTransforms.Length - 1)
            {
                list[stagenumber].SetActive(true);
            }
        }
        scale_time     += Time.deltaTime * 6;
        increment_scale = (max_scale - init_scale) * ((Mathf.Sin(scale_time) + 1) / 2);
        UiRectTransforms[stagenumber].localScale = init_scale + increment_scale;
    }
    /// <summary>
    /// カーソルの移動
    /// </summary>
    /// <param name="playerId"></param>
    void CursorMove(int playerId)
    {
        const float cursorSpeed = 1.5f;

        var stick = SwitchInput.GetStick(playerId) * cursorSpeed * Time.deltaTime;

        Vector3 cursorPos = playerUI[playerId].cursor.transform.position;

        playerUI[playerId].cursor.transform.position = new Vector3(
            Mathf.Clamp(cursorPos.x + stick.x, viewportMin.x, viewportMax.x),
            Mathf.Clamp(cursorPos.y + stick.y, viewportMin.y, viewportMax.y),
            cursorPos.z);

        PointerRaycast(playerId);
    }
 public override void MyStart()
 {
     //コントローラーの初期化
     Npad.Initialize();
     //サポートするタイプをセット
     Npad.SetSupportedIdType(npadIds);
     //サポートするスタイルをセット
     Npad.SetSupportedStyleSet(npadStyles);
     NpadJoy.SetHoldType(NpadJoyHoldType.Horizontal);
     //配列の要素確保
     isConnect = new bool[npadIds.Length];
     //入力の初期化
     SwitchInput.InputInit(npadIds.Length);
     SwitchAcceleration.AccelerationInit(npadIds.Length);
 }
Exemple #29
0
 public override void LateUpdate()
 {
     if (SwitchInput.GetButton(ballBehaviour.playerIndex, SwitchButton.Brake))
     {
         var velocity = ballBehaviour.thisRigidbody.velocity;
         velocity /= 1 + Time.deltaTime * ballBehaviour.brakePower;
         ballBehaviour.thisRigidbody.velocity = velocity;
         if (SwitchInput.GetButtonDown(ballBehaviour.playerIndex, SwitchButton.Brake) &&
             velocity.magnitude > 1.0f)
         {
             ballBehaviour.brakeSound.Play();
         }
     }
     AdjustNumberUI();
 }
Exemple #30
0
 private void FixedUpdate()
 {
     if (!GameOver && GameStart && !FieldManeger.Instance.Pause_Flg)
     {
         if (Mathf.Abs(SwitchInput.GetVertical(playerNumber)) >= 0.4f || Mathf.Abs(SwitchInput.GetHorizontal(playerNumber)) >= 0.4f)
         {
             //=====移動=====
             this.transform.Translate(Vector3.forward * walkSpeed * Time.deltaTime);
             //=====回転=====
             this.transform.rotation = Quaternion.LookRotation(transform.position +
                                                               (Vector3.forward * SwitchInput.GetVertical(playerNumber)) +
                                                               (Vector3.right * SwitchInput.GetHorizontal(playerNumber)) - transform.position);
         }
     }
     //重力
     rb.AddForce(Vector3.down * 60f);
 }