Exemplo n.º 1
0
    // クリック開始処理
    public void OnDragStart()
    {
        // クリックした位置のオブジェクトを取得
        RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);

        if (hit.collider != null)
        {
            // ピースの状態が何もなければ
            if (hit.transform.GetComponent <PuzzlePiece>().GetState() == DEFINE.PUZZLE_PIECE_STATE.NONE)
            {
                GameObject hitObj = hit.collider.gameObject;

                //オブジェクトの名前を前方一致で判定
                string pieceName = hitObj.name;

                if (pieceName.StartsWith("PuzzlePiece"))
                {
                    startPiece  = hitObj;
                    endPiece    = hitObj;
                    currentName = hitObj.name;

                    //削除対象オブジェクトリストの初期化
                    removablePieceList = new List <GameObject>();

                    //削除対象のオブジェクトを格納
                    PushToList(hitObj);


                    SE.PlaySE(12);
                }
            }
        }
    }
Exemplo n.º 2
0
    void Update()
    {
        float distCovered = (Time.time - startTime) * speed;
        float fracJourney = distCovered / journeyLength;

        // 粒子座標を更新
        transform.position = GetPoint(startMarker, P1Marker, P2Marker, endMarker, distCovered);


        // 終点まで来たら
        if (/*transform.position.x >= endMarker.x |*/ transform.position.y >= endMarker.y)
        {
            if (nID == 3)
            {
                gameManager.SetEffectFlag(true);
                nSkillCnt = 0;
            }
            // 粒子は破棄
            Destroy(gameObject);

            if (bflag == false)
            {
                // スキル・エフェクト生成
                EffectObject.PlayEffect(EffectID, new Vector3(endMarker.x, endMarker.y, 10), new Quaternion(0, 0, 0, 0));
                enemyRed.SetRedFlash(true);
                SE.PlaySE(14);
                SE.PlaySE(0);
                bflag = true;
            }
        }
    }
Exemplo n.º 3
0
    /*public void SetRankingTextByPlayerPrefs()
     * {
     *  string sceneName = SceneManager.GetActiveScene().name;
     *  string playerNameText = "";
     *  string timeText = "";
     *  for (int i = 1; i <= 10; i++)
     *  {
     *      if (!PlayerPrefs.HasKey(sceneName + "RankingPlayerName" + i)) break;
     *      playerNameText += i + ". " + PlayerPrefs.GetString(sceneName + "RankingPlayerName" + i) + "\n";
     *      timeText += PlayerPrefs.GetFloat(sceneName + "RankingTime" + i).ToString() + "\n";
     *  }
     *  this.rankingPlayerNameText.text = playerNameText;
     *  this.rankingScoreOrTimeText.text = timeText;
     *
     *  this.playerResultText.text = StaticData.playerName + ": " + TimeManager.Instance.CountTime;
     *
     *
     *  string recentPlayerNameText = "";
     *  string dateText = "";
     *  for (int i = 1; i <= 10; i++)
     *  {
     *      if (!PlayerPrefs.HasKey(sceneName + "RecentPlayerName" + i)) break;
     *      recentPlayerNameText += i + ". " + PlayerPrefs.GetString(sceneName + "RecentPlayerName" + i) + "\n";
     *      dateText += PlayerPrefs.GetString(sceneName + "RecentDate" + i) + "\n";
     *  }
     *  this.recentPlayerNameText.text = recentPlayerNameText;
     *  this.recentDateText.text = dateText;
     * }*/

    public void SetResultAndShowUsedStaticData()
    {
        this.rankingPlayerNameText.text  = StaticData.highRankResults[SceneManager.GetActiveScene().name].PlayerNameText;
        this.rankingScoreOrTimeText.text = StaticData.highRankResults[SceneManager.GetActiveScene().name].ResultTimeText;
        this.recentPlayerNameText.text   = StaticData.recentResults[SceneManager.GetActiveScene().name].PlayerNameText;
        this.recentDateText.text         = StaticData.recentResults[SceneManager.GetActiveScene().name].ClearDateText;

        this.playerResultText.text = StaticData.playerName + ": " + TimeManager.Instance.CountTime;
        StageManager.Instance.StopAllMoving();
        //StartCoroutine(DelayMethodRealTime(0.3f, () =>
        //{
        SEManager.PlaySE(SEManager.failed);
        this.scoreText.SetActive(false);
        this.timeText.SetActive(false);
        this.flagCountText.transform.gameObject.SetActive(false);
        this.gameOverText.SetActive(true);
        this.smogPanel.SetActive(true);
        //}));
        StartCoroutine(DelayMethodRealTime(0.3f, () =>
        {
            this.gameOverText.SetActive(false);
        }));
        StartCoroutine(DelayMethodRealTime(0.5f, () =>
        {
            SEManager.PlaySE(SEManager.getItem);
            this.rankingPanel.SetActive(true);
            this.tweetResultButton.SetActive(false);
            this.continueButton.Select();
        }));
    }
Exemplo n.º 4
0
 public void PressNextManual()
 {
     this.manual[this.currentIndex].SetActive(false);
     this.currentIndex = (++this.currentIndex) % this.manualLength;
     this.manual[this.currentIndex].SetActive(true);
     SEManager.PlaySE(SEManager.page);
 }
Exemplo n.º 5
0
    /*public IEnumerator SetAndShowRankingWhenFailed()
     * {
     *  this.playerResultText.text = StaticData.playerName + ": " + TimeManager.Instance.CountTime;
     *  StageManager.Instance.StopAllMoving();
     *  //SetRankingTextByPlayerPrefs();
     *  //StartCoroutine(DelayMethodRealTime(0.5f, () =>
     *  //{
     *      SEManager.PlaySE(SEManager.failed);
     *      this.scoreText.SetActive(false);
     *      this.timeText.SetActive(false);
     *      this.flagCountText.transform.gameObject.SetActive(false);
     *      this.gameOverText.SetActive(true);
     *      this.smogPanel.SetActive(true);
     *  //}));
     *  StartCoroutine(DelayMethodRealTime(0.5f, () =>
     *  {
     *      this.gameOverText.SetActive(false);
     *  }));
     *
     *  StartCoroutine(SetHighRankingTextFromFailedResult());
     *  yield return StartCoroutine(SetRecentClearTextFromFailedResult());
     *
     *  SEManager.PlaySE(SEManager.getItem);
     *  this.rankingPanel.SetActive(true);
     *  this.tweetResultButton.SetActive(false);
     *  this.continueButton.Select();
     * }*/

    public IEnumerator SetAndShowRankingWhenClear()
    {
        this.playerResultText.text = StaticData.playerName + ": " + TimeManager.Instance.CountTime;
        StageManager.Instance.StopAllMoving();

        //StartCoroutine(DelayMethodRealTime(0.5f, () =>
        //{
        SEManager.PlaySE(SEManager.success);
        this.scoreText.SetActive(false);
        this.timeText.SetActive(false);
        this.flagCountText.transform.gameObject.SetActive(false);
        this.stageClearText.SetActive(true);
        this.smogPanel.SetActive(true);
        //}));
        StartCoroutine(DelayMethodRealTime(0.5f, () =>
        {
            this.stageClearText.SetActive(false);
        }));

        StartCoroutine(SetHighRankingTextFromClearResult());
        yield return(StartCoroutine(SetRecentClearTextFromClearResult()));

        SEManager.PlaySE(SEManager.getItem);
        this.rankingPanel.SetActive(true);
        this.continueButton.Select();
        StageManager.Instance.SavePlayerResult();
    }
Exemplo n.º 6
0
 public void ViewStaff()
 {
     SEManager.PlaySE(SEManager.decision);
     this.optionView.SetActive(false);
     this.staffView.SetActive(true);
     this.backFromViewStaffButton.Select();
 }
Exemplo n.º 7
0
    public void ClearCombo()
    {
        //todo;コンボが3より大きければ秒数を増やす

        if (DragObjList.Count > 3)
        {
            m_limitTimeCountViwer.PlusTime();
        }

        if (DragObjList.Count > 2)
        {
            m_SEManager.PlaySE();
        }

        foreach (var orbs in DragObjList)
        {
            if (orbs.GetComponent <OrbController>().ComboEffect.gameObject.activeSelf)
            {
                orbs.GetComponent <OrbController>().ComboEffect.gameObject.SetActive(false);
            }
            CurrentComboCount++;
        }

        DragObjList.Clear();
    }
Exemplo n.º 8
0
 public void BackFromViewStaff()
 {
     SEManager.PlaySE(SEManager.back);
     this.staffView.SetActive(false);
     this.optionView.SetActive(true);
     this.resumeButton.Select();
 }
Exemplo n.º 9
0
 public void PressGoTitle()
 {
     //初期化処理
     BGMManager.PlayBGM(BGMManager.menuBGM);
     SEManager.PlaySE(SEManager.decision);
     SceneManager.LoadScene("Title");
 }
Exemplo n.º 10
0
 public void ShowStageOverView(int overViewIndex)
 {
     StageManager.Instance.StopAllMoving();
     this.stageOverViewsPanel.SetActive(true);
     this.overViews[overViewIndex].SetActive(true);
     SEManager.PlaySE(SEManager.decision);
 }
Exemplo n.º 11
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         SEManager.PlaySE(SEManager.speedUp);
         collision.transform.parent.GetComponent <Rigidbody2D>().AddRelativeForce(new Vector2(0f, this.moveForce));
     }
 }
Exemplo n.º 12
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         SEManager.PlaySE(SEManager.speedDown);
         collision.transform.parent.GetComponent <Rigidbody2D>().velocity *= this.lowerRate;
     }
 }
Exemplo n.º 13
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         SEManager.PlaySE(SEManager.returnMoveDirection);
         collision.transform.parent.Rotate(0f, 0f, 180f);
     }
 }
Exemplo n.º 14
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (StageManager.Instance.ClearFlagType == E_ClearFlagType.BreakTarget && collision.CompareTag("AttackToEnemy"))
     {
         SEManager.PlaySE(SEManager.getItem);
         this.breakTarget.Invoke();
         ClearFlag_BreakTarget.Instance.BreakTarget();
         Destroy(this.gameObject);
     }
 }
Exemplo n.º 15
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         SEManager.PlaySE(SEManager.getItem);
         TimeManager.Instance.AddTime(this.addTimeValue);
         this.contactPlayerEvent.Invoke();
         Destroy(this.gameObject);
     }
 }
Exemplo n.º 16
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         SEManager.PlaySE(SEManager.stopMovement);
         Rigidbody2D p_rb = collision.transform.parent.GetComponent <Rigidbody2D>();
         p_rb.velocity        = Vector2.zero;
         p_rb.angularVelocity = 0f;
     }
 }
Exemplo n.º 17
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (StageManager.Instance.ClearFlagType == E_ClearFlagType.CollectItem && collision.CompareTag("Player"))
     {
         SEManager.PlaySE(SEManager.getItem);
         this.getMustCollectItem.Invoke();
         ClearFlag_CollectItem.Instance.GetMustCollectItem();
         Destroy(this.gameObject);
     }
 }
Exemplo n.º 18
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Return))
     {
         SEManager.PlaySE(SEManager.E_SE.Slash);
     }
     if (Input.GetKeyDown(KeyCode.W))
     {
         SEManager.PlaySE(SEManager.E_SE.Jump);
     }
 }
Exemplo n.º 19
0
 public void PressBackManual()
 {
     this.manual[this.currentIndex].SetActive(false);
     this.currentIndex--;
     if (this.currentIndex < 0)
     {
         this.currentIndex = this.manualLength - 1;
     }
     this.manual[this.currentIndex].SetActive(true);
     SEManager.PlaySE(SEManager.page);
 }
Exemplo n.º 20
0
 public void PressBackMissionRankingButton()
 {
     SEManager.PlaySE(SEManager.select);
     this.scrollViews[this.showingMissionIndex].SetActive(false);
     this.showingMissionIndex--;
     if (this.showingMissionIndex < 0)
     {
         this.showingMissionIndex = this.missionCount - 1;
     }
     this.scrollViews[this.showingMissionIndex].SetActive(true);
     this.RankingTitleText.text = "ランキング(Mission" + (this.showingMissionIndex + 1).ToString() + ")";
 }
Exemplo n.º 21
0
 public void SetPlayerName()
 {
     if (this.inputField.text == "")
     {
         SEManager.PlaySE(SEManager.speedDown);
     }
     else
     {
         SEManager.PlaySE(SEManager.decision);
         StaticData.playerName = this.inputField.text;
         SceneManager.LoadScene("SelectMissionStage");
     }
 }
Exemplo n.º 22
0
    // Update is called once per frame
    void Update()
    {
        nSetCnt++;

        // プレイヤーがセットされてたら
        if (nSetNum == 0)
        {
            spriteRenderer.sprite = playerTurn;
        }
        // エネミーがセットされてたら
        else if (nSetNum == 1)
        {
            spriteRenderer.sprite = enemyTurn;
        }

        if (nSetCnt >= 60)
        {
            if (bAlphaOn == false && bFirstTime == true)
            {
                fAlpha += 0.03f;
            }

            if (fAlpha >= 1.0f)
            {
                fAlpha = 1.0f;
                nCnt++;
                bAlphaOn = true;
                if (se == false)
                {
                    SE.PlaySE(16);
                    se = true;
                }
            }

            if (nCnt >= 30)
            {
                fAlpha -= 0.03f;

                if (fAlpha <= 0)
                {
                    fAlpha     = 0;
                    nCnt       = 0;
                    bAlphaOn   = false;
                    bFirstTime = false;
                    se         = false;
                }
            }
        }

        spriteRenderer.color = new Color(1.0f, 1.0f, 1.0f, fAlpha);
    }
Exemplo n.º 23
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Q))
        {
            GetComponent <SpriteRenderer>().sprite = tex1;

            se.PlaySE(3);

            em.PlayEffect(0, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0));
        }

        if (Input.GetKeyDown(KeyCode.W))
        {
            GetComponent <SpriteRenderer>().sprite = tex2;

            se.PlaySE(4);

            em.PlayEffect(3, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0));
        }

        if (Input.GetKeyDown(KeyCode.E))
        {
            GetComponent <SpriteRenderer>().sprite = tex3;

            se.PlaySE(5);

            em.PlayEffect(10, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0));
        }

        if (Input.GetKeyDown(KeyCode.R))
        {
            GetComponent <SpriteRenderer>().sprite = tex4;

            se.PlaySE(50);

            em.PlayEffect(15, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0));
        }
    }
Exemplo n.º 24
0
 public void PressGoStage()
 {
     SEManager.PlaySE(SEManager.decision);
     StageManager.Instance.MoveAllMoving();
     if (this.gameObject.name == "Mission10" || this.gameObject.name == "Mission11")
     {
         BGMManager.PlayBGM(BGMManager.bossBGM0);
     }
     else
     {
         BGMManager.PlayBGM(BGMManager.missionBGM);
     }
     SceneManager.LoadScene(this.gameObject.name);
 }
Exemplo n.º 25
0
 public void PressResume()
 {
     SEManager.PlaySE(SEManager.back);
     StageManager.Instance.MoveAllMoving();
     if (!StageManager.Instance.IsStageScene)
     {
         if (MenuUIManager.Instance.CurrentSelectType == E_MenuType.Option)
         {
             MenuUIManager.Instance.OptionPanel.SetActive(true);
         }
         OptionClickManager.Instance.OptionIcon.SetActive(true);
     }
     this.gameObject.SetActive(false);
 }
Exemplo n.º 26
0
    public void UpdateScore(Vector3 pos)
    {
        // 上からレイを出して確認する
        int min = 9999;
        int max = 0;

        for (int i = 0; i < Width; ++i)
        {
            RaycastHit hit;
            Ray        ray = new Ray(new Vector3(i, fallBlock.transform.position.y - 1, 0), Vector3.down);
            Physics.Raycast(ray, out hit);
            score [i] = Mathf.RoundToInt(hit.transform.position.y + 0.3f);             // 時間がないのでマジックナンバー
            if (min > score [i])
            {
                min = score [i];
            }
            if (max < score [i])
            {
                max = score [i];
            }
        }
        Debug.Log(max);
        //minとmaxが5以上離れていれば終わり
        Debug.Log(min.ToString() + ":" + max.ToString());
        if (min + 5 < max)
        {
            gameManager.FinishGame();
            return;
        }
        // ライン揃えたボーナス
        if (prevMaxHeight < min)
        {
            prevMaxHeight = min;
            p_seManager.PlaySE(2);
            scoreManager.AddScore(oneLineScore);
            ViewOneLineScore(pos);
        }

        // 一番下が3を超えたらだんだん高くなる
        if (min - 1 > climb)
        {
            ++climb;
            Camera.main.transform.position   += Vector3.up;
            fallBlock.transform.position     += Vector3.up;
            nextFallBlock.transform.position += Vector3.up;
            nextFallPos     += Vector3.up;
            standardFallPos += Vector3.up;
        }
    }
Exemplo n.º 27
0
    public void ClearCombo()
    {
        if (DragObjList.Count > 4)
        {
            m_limitTimeCountViewer.PlusTime();
        }
        if (DragObjList.Count > 2)
        {
            m_semanager.PlaySE();
        }
        //コンボが3以上だったら増やす
        foreach (var orbs in DragObjList)
        {
            if (orbs.GetComponent <OrbController>().ComboEffect.gameObject.gameObject)
            {
                orbs.GetComponent <OrbController>().ComboEffect.gameObject.SetActive(false);
            }
        }
        DragObjList.Clear();

        m_semanager.PlaySE();

        DragObjList.Clear();
    }
Exemplo n.º 28
0
 public void PressResume()
 {
     SEManager.PlaySE(SEManager.back);
     if (StageManager.Instance.IsStageScene)
     {
         StageUIManager.Instance.PausePanel.SetActive(true);
         StageUIManager.Instance.ResumeButton.Select();
     }
     else
     {
         StageManager.Instance.MoveAllMoving();
         MenuUIManager.Instance.ManualPanel.SetActive(true);
         OptionClickManager.Instance.OptionIcon.SetActive(true);
     }
     this.gameObject.SetActive(false);
 }
Exemplo n.º 29
0
    //--------------------------------------------------
    // スタート
    //--------------------------------------------------
    void Start()
    {
        GameState    = DEFINE.GAME_STATE.PLAYER_TURN;                       // ゲーム状態
        player       = GetComponent <Player>();                             // プレイヤー情報を取得
        enemy        = GetComponent <Enemy>();                              // エネミー情報を取得
        PieceList    = GetComponentInChildren <PieceList>();                // ピースのリストを取得
        skillChecker = GetComponent <SkillChecker>();                       // スキル情報を取得

        nCnt = 0;
        SE.PlaySE(1);
    }
Exemplo n.º 30
0
 public void ClickOptionIcon()
 {
     if (this.optionPanel.activeSelf)
     {
         this.optionPanel.SetActive(false);
         SEManager.PlaySE(SEManager.back);
         StageManager.Instance.MoveAllMoving();
     }
     else
     {
         //StageManager.Instance.IsPausing = true;
         StageManager.Instance.StopAllMoving();
         this.optionPanel.SetActive(true);
         this.resumeButton.Select();
         SEManager.PlaySE(SEManager.pause);
     }
 }