Example #1
0
 private void Update()
 {
     if (STBInput.GetButtonDown("Pause"))
     {
         PauseMenu.instance.CallPauseMenu();
     }
 }
Example #2
0
    protected override void Update()
    {
        base.Update();

        if (IsActivated && STBInput.GetButtonDown("Cancel"))
        {
            SoundManager.instance.PlayUiEfx(UiEfx.CANCEL);
            MenuController.instance.OnMainMenuCancel();
        }
    }
Example #3
0
    void Update()
    {
        if (STBInput.GetButtonDown("Pause"))
        {
            PauseMenu.instance.CallPauseMenu();
        }

        if (!IsSceneOver && Player.IsDeath)
        {
            OnStageFailed();
        }
    }
Example #4
0
    void Update()
    {
#if OPEN_DEBUG_MODE
        if (Input.GetKeyDown(KeyCode.PageDown))
        {
            OnSceneEnd();
        }
#endif

        if (isParaOver)
        {
            bool showNext = false;

            if (isPageOver)
            {
                if (STBInput.GetButtonDown("Next") || STBInput.GetButtonDown("Skip"))
                {
                    SoundManager.instance.PlayUiEfx(UiEfx.TEXT);
                    showNext   = true;
                    isPageOver = false;
                    pageEndMark.Hide();
                    storyBoard.ClearAll();
                }
            }
            else
            {
                if (STBInput.GetButtonDown("Next") || STBInput.GetButton("Skip"))
                {
                    SoundManager.instance.PlayUiEfx(UiEfx.TEXT);
                    showNext = true;
                    paraEndMark.Hide();
                }
            }

            if (showNext)
            {
                isParaOver = false;
                if (currentPara < currentStory.Length)
                {
                    StartCoroutine(ShowPara());
                }
                else
                {
                    storyBoard.ClearAll();
                    OnSceneEnd();
                }
            }
        }
    }
Example #5
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         if (instance != this)
         {
             Destroy(gameObject);
         }
     }
     DontDestroyOnLoad(gameObject);
 }
Example #6
0
    protected override void Update()
    {
        if (!IsCurrentActive())
        {
            return;
        }

        base.Update();

        if (STBInput.GetButtonDown("Cancel"))
        {
            SoundManager.instance.PlayUiEfx(UiEfx.CANCEL);
            ContinueGame();
        }
    }
Example #7
0
    protected override void Update()
    {
        if (!IsCurrentActive())
        {
            return;
        }

        base.Update();

        if (STBInput.GetButtonDown("Cancel"))
        {
            SoundManager.instance.PlayUiEfx(UiEfx.CANCEL);
            MenuController.instance.BackToMainMenu(true);
        }
    }
Example #8
0
    void Update()
    {
        if (STBInput.GetButtonDown("Pause"))
        {
            PauseMenu.instance.CallPauseMenu();
        }

        if (!IsSceneOver && Player.IsDeath)
        {
            OnStageFailed();
        }

        HUDManager.instance.SetHP(BOSS_ID_POPOLA, popola.healthPoint / BOSS_HP);
        HUDManager.instance.SetHP(BOSS_ID_DEVOLA, devola.healthPoint / BOSS_HP);
    }
    static void CreateRequiredPresets()
    {
        for (int j = 0; j <= STBInput.JoystickCount; j++)
        {
            for (int i = 0; i < STBInput.AxisCount; i++)
            {
                axes.Add(new AxisPreset(STBInput.JoystickAxisName(i, j), 2, i, j));
            }
            for (int i = 0; i < STBInput.ButtonCount; i++)
            {
                axes.Add(new AxisPreset(STBInput.JoystickButtonName(i, j), 0, i, j));
            }
        }

        axes.Add(new AxisPreset("Mouse X", 1, 0, 0));
        axes.Add(new AxisPreset("Mouse Y", 1, 1, 0));
        axes.Add(new AxisPreset("Mouse Z", 1, 2, 0));
    }
Example #10
0
    void Update()
    {
        switch (STBInput.GetPlayerDeviceType(0))
        {
        case InputDeviceType.KeyboardAndMouse:
            info.text = hints[0];
            break;

        case InputDeviceType.PS4Controller:
            info.text = hints[1];
            break;

        case InputDeviceType.XboxOneController:
            info.text = hints[2];
            break;

        default:
            info.text = hints[2];
            break;
        }
    }
Example #11
0
    void Update()
    {
        if (GameCursor.isActivated)
        {
            if (PauseMenu.isPaused ||
                STBInput.GetAxis("HorizontalRotate") != 0 || STBInput.GetAxis("VerticalRotate") != 0)
            {
                Destroy(cursor.gameObject);
            }
        }
        else
        {
            if (!PauseMenu.isPaused &&
                (Input.GetAxis("Mouse X") != 0f || Input.GetAxis("Mouse Y") != 0))
            {
                if (cursor == null)
                {
                    cursor = Instantiate(cursorPrefab);
                }
            }
        }

        if (GameCursor.isActivated)
        {
            Ray        ray = thisCamera.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit, 100, LayerMask.GetMask("CursorDetector")))
            {
                cursor.transform.position = hit.point;
            }
            if (Input.GetMouseButtonDown(0))
            {
                cursor.SetFocus(true);
            }
            if (Input.GetMouseButtonUp(0))
            {
                cursor.SetFocus(false);
            }
        }
    }
Example #12
0
    protected override void Update()
    {
        if (!IsCurrentActive())
        {
            return;
        }

        base.Update();

        if (STBInput.GetButtonDown("Cancel"))
        {
            SoundManager.instance.PlayUiEfx(UiEfx.CANCEL);
            if (LastPressed == null)
            {
                FadeOut(0.4f);
                EventSystem.current.SetSelectedGameObject(null);
            }
            else
            {
                LastPressed.SetPressed(false);
            }
        }
    }
Example #13
0
    protected override void Update()
    {
        if (!IsCurrentActive())
        {
            return;
        }

        base.Update();

        if (STBInput.GetButtonDown("Cancel"))
        {
            SoundManager.instance.PlayUiEfx(UiEfx.CANCEL);
            if (LastPressed == null)
            {
                MenuController.instance.BackToOptionsMenu();
                EventSystem.current.SetSelectedGameObject(null);
            }
            else
            {
                LastPressed.SetPressed(false);
                EventSystem.current.SetSelectedGameObject(LastFocused.gameObject);
            }
        }
    }
Example #14
0
    private void Update()
    {
        if (currentPlatform != -1 && currentEnemy == null)
        {
            EnemyBulletManager.instance.DestroyAll();
            isClear[currentPlatform] = true;
            lastClear  = currentPlatform;
            IsInBattle = false;

            if (currentPlatform == 17)
            {
                endBridge.Open();
            }
            else
            {
                bridgeGroups[currentPlatform].Open();
            }

            if (GameManager.IsGameLevelHigher(GameLevel.Hard))
            {
                redCubes.BlinkOut();
            }

            currentPlatform = -1;
        }

        if (STBInput.GetButtonDown("Pause"))
        {
            PauseMenu.instance.CallPauseMenu();
        }

        if (!IsSceneOver && Player.IsDeath)
        {
            OnStageFailed();
        }
    }
Example #15
0
    void LateUpdate()
    {
        //Movement

        Vector3 movement = Vector3.zero;
        float   horInput = STBInput.GetAxis("HorizontalMove");
        float   verInput = STBInput.GetAxis("VerticalMove");

        Matrix4x4 rotCamera = Matrix4x4.Rotate(Quaternion.Euler(0f, Camera.main.transform.eulerAngles.y, 0f));

        if (horInput != 0 || verInput != 0)
        {
            movement.x = horInput * moveSpeed;
            movement.z = verInput * moveSpeed;
            movement   = Vector3.ClampMagnitude(movement, moveSpeed);
            if (GameManager.IsDirectionAdjustOn)
            {
                float     angle  = Camera.main.AdjustAngle(transform.position, movement);
                Matrix4x4 adjust = Matrix4x4.Rotate(Quaternion.Euler(0f, angle, 0f));
                movement = adjust * movement;
            }
            movement = rotCamera * movement;
        }

        if (GameCursor.isActivated)
        {
            Vector3 rotation = GameCursor.GetPosition() - transform.position;
            rotation.y = 0f;
            if (rotation != Vector3.zero)
            {
                Quaternion direction = Quaternion.LookRotation(rotation);
                transform.rotation = Quaternion.Lerp(transform.rotation, direction, rotSpeed * Time.deltaTime);
            }
        }
        else
        {
            float horRotInput = STBInput.GetAxis("HorizontalRotate");
            float verRotInput = STBInput.GetAxis("VerticalRotate");
            if (horRotInput != 0 || verRotInput != 0)
            {
                Vector3 lookDir = new Vector3(horRotInput, 0f, verRotInput);
                if (GameManager.IsDirectionAdjustOn)
                {
                    float     angle  = Camera.main.AdjustAngle(transform.position, lookDir);
                    Matrix4x4 adjust = Matrix4x4.Rotate(Quaternion.Euler(0f, angle, 0f));
                    lookDir = adjust * lookDir;
                }
                lookDir = rotCamera * lookDir;
                Quaternion direction = Quaternion.LookRotation(lookDir);
                transform.rotation = Quaternion.Lerp(transform.rotation, direction, rotSpeed * Time.deltaTime);
            }
            else if (movement.magnitude != 0f)
            {
                Quaternion direction = Quaternion.LookRotation(movement);
                transform.rotation = Quaternion.Lerp(transform.rotation, direction, rotSpeed * Time.deltaTime);
            }
        }

        flame.CheckSpeed(movement);

        if (!charaController.isGrounded)
        {
            charaController.Move(new Vector3(0f, -9.8f, 0f) * Time.deltaTime);
        }
        movement *= Time.deltaTime;
        if (IsMovable)
        {
            charaController.Move(movement);
        }

        //Wingmen

        if (wingmen.Count != 0)
        {
            for (int i = wingmen.Count - 1; i >= 0; i--)
            {
                if (wingmen[i] == null)
                {
                    wingmen.RemoveAt(i);
                }
            }
        }

        //Attack

        if (IsArmed)
        {
            timeFireRecharge += Time.deltaTime;
            if (STBInput.GetButton("Fire"))
            {
                if (timeFireRecharge > fireGap)
                {
                    Fire();
                }
            }
            else
            {
                timeFireRecharge = Mathf.Clamp(timeFireRecharge, 0f, fireGap);
            }
        }
    }
Example #16
0
 public override bool GetButtonDown(string buttonName)
 {
     return(STBInput.GetButtonDown(buttonName));
 }
Example #17
0
 public override float GetAxisRaw(string axisName)
 {
     return(STBInput.GetAxisRaw(axisName));
 }
Example #18
0
    void Update()
    {
        //For BGM states

        float current = SoundManager.instance.Current;

        if (isFinalEntered)
        {
            if (wingCount <= 0)
            {
                if (current >= BGM_LOOP_POINT[1] + BGM_LOOP_LENGTH[1])
                {
                    SoundManager.instance.SeekTo(current - BGM_LOOP_LENGTH[1]);
                }
            }
            else
            {
                if (!isChorusStarted)
                {
                    if (current < BGM_CHORUS_POINT)
                    {
                        isChorusStarted = true;
                    }
                    else
                    {
                        if (current >= BGM_LOOP_POINT[1] + BGM_LOOP_LENGTH[1])
                        {
                            SoundManager.instance.SeekTo(current - BGM_LOOP_LENGTH[1]);
                        }
                    }
                }
                else
                {
                    if (currentBgm != 2)
                    {
                        if (current >= BGM_CHORUS_POINT)
                        {
                            currentBgm = 2;
                            SoundManager.instance.PlayBgm(bgms[2]);
                            SoundManager.instance.SeekTo(current + BGM_OFFSET);
                        }
                    }
                    else
                    {
                        if (current >= BGM_LOOP_POINT[2] + BGM_LOOP_LENGTH[2])
                        {
                            SoundManager.instance.PlayBgm(bgms[2], 3f);
                            SoundManager.instance.SeekTo(current - BGM_LOOP_LENGTH[2]);
                        }
                    }
                }
            }
        }
        else
        {
            if (current >= BGM_LOOP_POINT[0] + BGM_LOOP_LENGTH[0])
            {
                SoundManager.instance.SeekTo(current - BGM_LOOP_LENGTH[0]);
            }
        }

        //For Enemy States

        if (isInRecoverPhase)
        {
            if (checkedCount < 4)
            {
                for (int i = EnemyManager.instance.Count; i < 4 + checkedCount; i++)
                {
                    EnemyManager.instance.SetEnemy(enemyPrefab, GetRandomPosition());
                }
            }
            else
            {
                if (EnemyManager.instance.IsEmpty)
                {
                    isInRecoverPhase       = false;
                    enemyBoss.IsInvincible = false;
                }
            }
        }

        if (STBInput.GetButtonDown("Pause"))
        {
            PauseMenu.instance.CallPauseMenu();
        }

        if (!IsSceneOver && Player.IsDeath)
        {
            OnStageFailed();
        }
    }
Example #19
0
    IEnumerator ShowPara()
    {
        StoryPara para = currentStory[currentPara];

        if (!para.IsTag)
        {
            storyBoard.AddText(para.x, para.y);
            currentChar = 0;
            float time      = 0f;
            float efxTime   = 0f;
            bool  isSpeedUp = false;
            while (currentChar < para.Length)
            {
                yield return(null);

                if (STBInput.GetButtonDown("Next"))
                {
                    isSpeedUp = true;
                }
                if (STBInput.GetButtonUp("Next"))
                {
                    isSpeedUp = false;
                }
                if (STBInput.GetButton("Skip"))
                {
                    currentChar = para.Length - 1;
                }

                time    += Time.deltaTime * (isSpeedUp ? 5f : 1f);
                efxTime += Time.deltaTime;

                if (time > TEXT_GAP)
                {
                    currentChar++;
                    if (efxTime >= TEXT_GAP)
                    {
                        SoundManager.instance.PlayUiEfx(UiEfx.TEXT);
                        while (efxTime >= TEXT_GAP)
                        {
                            efxTime -= TEXT_GAP;
                        }
                    }
                    storyBoard.SetText(para.Substring(currentChar));
                    if (para.GetChar(currentChar - 1).Equals('\n'))
                    {
                        time -= TEXT_GAP * 5f;
                    }
                    else
                    {
                        time -= TEXT_GAP;
                    }
                }
            }
            isParaOver = true;
            paraEndMark.Set(GetActPos(storyBoard.GetEndPosition()));
            currentPara++;
            para = currentStory[currentPara];
        }

        if (para.IsTag)
        {
            currentPara++;
            if (para.IsBgmPlay)
            {
                SoundManager.instance.PlayBgm(bgm, 2f);
            }
            if (para.IsBgmStop)
            {
                SoundManager.instance.StopBgm(1f);
            }
            if (para.IsPageEnd)
            {
                paraEndMark.Hide();
                pageEndMark.Set();
                isPageOver = true;
                yield break;
            }
            if (para.IsClipEnd)
            {
                OnSceneEnd();
                yield break;
            }
            if (!isParaOver)
            {
                StartCoroutine(ShowPara());
            }
        }
    }