Beispiel #1
0
    //----------------------------------------------------------------------
    // コンストラクタ
    //----------------------------------------------------------------------
    // @Param	none
    // @Return	none
    // @Date	2014/12/10  @Update 2014/12/10  @Author T.Kawashita
    //----------------------------------------------------------------------
    void Start()
    {
        m_status = eSTATUS_VICTORYPERFORMANCE.eFADE_IN;

        if (TeamData.GetWinTeamNo() == 0 || TeamData.GetWinTeamNo() == 1)
        {
            GameObject.Instantiate(Resources.Load("Prefab/Result/player_victory"));
        }
        else if (TeamData.GetWinTeamNo() == 2)
        {
            GameObject.Instantiate(Resources.Load("prefab/Result/player_draw_1"));
        }

        m_soundPlayer = new CSoundPlayer();
        m_soundPlayer.ChangeSEVolume(0.2f);
        m_soundPlayer.PlaySE("result/supoter_finish");

        // パネル取得
        m_mainUIPanel = GameObject.Find("MainUI").transform.FindChild("Camera").transform.FindChild("Anchor").transform.FindChild("Panel").gameObject;
        m_1p2pUIPanel = GameObject.Find("1p2pUI").transform.FindChild("Camera").transform.FindChild("Anchor").transform.FindChild("Panel").gameObject;
        m_3p4pUIPanel = GameObject.Find("3p4pUI").transform.FindChild("Camera").transform.FindChild("Anchor").transform.FindChild("Panel").gameObject;

        m_mainUIPanel.transform.FindChild("BlackOut").gameObject.AddComponent <CFadeIn> ();
        m_1p2pUIPanel.transform.FindChild("BlackOut").gameObject.AddComponent <CFadeIn> ();
        m_3p4pUIPanel.transform.FindChild("BlackOut").gameObject.AddComponent <CFadeIn> ();

        if (TeamData.GetWinTeamNo() == 0 || TeamData.GetWinTeamNo() == 1)
        {
            m_motionPlayer = GameObject.Find("player_victory(Clone)").gameObject;
        }
        else if (TeamData.GetWinTeamNo() == 2)
        {
            m_motionPlayer = GameObject.Find("player_draw_1(Clone)").gameObject;
        }
        m_mainCamera = GameObject.Find("MainCamera").gameObject;
        m_1p2pCamera = GameObject.Find("1p2pCamera").gameObject;
        m_3p4pCamera = GameObject.Find("3p4pCamera").gameObject;

        m_flame = 0.0f;

//		m_motionPlayer.animation.Stop ();
    }
Beispiel #2
0
    //----------------------------------------------------------------------
    // 更新
    //----------------------------------------------------------------------
    // @Param	none
    // @Return	none
    // @Date	2015/01/09  @Update 2015/01/09  @Author T.Takeuchi
    //----------------------------------------------------------------------
    void Update()
    {
        // Input
        if (Input.GetKeyDown(InputXBOX360.P1_XBOX_START) && this.buttonCheck[0] == false)
        {
            m_soundPlayer.PlaySE("tutorial/button_push");
            this.buttonCheck[0] = true;
        }
        if (Input.GetKeyDown(InputXBOX360.P2_XBOX_START) && this.buttonCheck[1] == false)
        {
            m_soundPlayer.PlaySE("tutorial/button_push");
            this.buttonCheck[1] = true;
        }
        if (Input.GetKeyDown(InputXBOX360.P3_XBOX_START) && this.buttonCheck[2] == false)
        {
            m_soundPlayer.PlaySE("tutorial/button_push");
            this.buttonCheck[2] = true;
        }
        if (Input.GetKeyDown(InputXBOX360.P4_XBOX_START) && this.buttonCheck[3] == false)
        {
            m_soundPlayer.PlaySE("tutorial/button_push");
            this.buttonCheck[3] = true;
        }
        if (Input.GetKeyDown(KeyCode.LeftShift))
        {
            m_soundPlayer.PlaySE("tutorial/button_push");
            this.buttonCheck[0] = this.buttonCheck[1] = true;
        }
        if (Input.GetKeyDown(KeyCode.RightShift))
        {
            m_soundPlayer.PlaySE("tutorial/button_push");
            this.buttonCheck[2] = this.buttonCheck[3] = true;
        }



        // 遷移
        switch (this.state)
        {
        case TUTORIAL_STATE.WAIT:
            this.state = TUTORIAL_STATE.INIT;
            return;


        case TUTORIAL_STATE.INIT:
            InitTutorial();
            this.state = TUTORIAL_STATE.FAID_IN;
            break;


        case TUTORIAL_STATE.FAID_IN:
            if (!this.bloackOut[0].GetComponent <TweenAlpha>().enabled&&
                !this.bloackOut[1].GetComponent <TweenAlpha>().enabled&&
                !this.bloackOut[2].GetComponent <TweenAlpha>().enabled)
            {
                ReSetButtonCheck();
                this.state += 1;
            }
            break;


        case TUTORIAL_STATE.TUTORIAL0:
            if (GetButtonCheck())
            {
                m_soundPlayer.PlaySE("tutorial/tutorial_next");
                ReSetButtonCheck();
                this.state += 1;
            }
            break;


        case TUTORIAL_STATE.TUTORIAL1:
            this.guidVewer[0].SetActive(false);
            this.guidVewer[1].SetActive(true);
            this.guidVewer[1].GetComponent <UISprite>().spriteName = "user'sGuide_2";
            this.guidVewer[2].SetActive(true);
            this.guidVewer[2].GetComponent <UISprite>().spriteName = "user'sGuide_3";

            if (GetButtonCheck())
            {
                m_soundPlayer.PlaySE("tutorial/tutorial_next");
                ReSetButtonCheck();
                this.state += 1;
            }
            break;


        case TUTORIAL_STATE.TUTORIAL2:
            this.guidVewer[0].SetActive(false);
            this.guidVewer[1].SetActive(true);
            this.guidVewer[1].GetComponent <UISprite>().spriteName = "user'sGuide_4";
            this.guidVewer[2].SetActive(true);
            this.guidVewer[2].GetComponent <UISprite>().spriteName = "user'sGuide_5";

            if (GetButtonCheck())
            {
                m_soundPlayer.PlaySE("tutorial/tutorial_next");
                ReSetButtonCheck();
                this.state += 1;
            }
            break;


        case TUTORIAL_STATE.TUTORIAL3:
            this.guidVewer[0].SetActive(false);
            this.guidVewer[1].SetActive(true);
            this.guidVewer[1].GetComponent <UISprite>().spriteName = "Instruction06";
            this.guidVewer[2].SetActive(true);
            this.guidVewer[2].GetComponent <UISprite>().spriteName = "Instruction07";

            for (int i = 0; i < 4; i++)
            {
                player[i].GetComponent <CPlayer>().m_gauge.m_gauge = 210;
            }

            if (GetButtonCheck())
            {
                m_soundPlayer.PlaySE("tutorial/tutorial_next");
                ReSetButtonCheck();
                this.state += 1;
            }
            break;


        case TUTORIAL_STATE.TUTORIAL4:
            this.guidVewer[0].SetActive(true);
            this.guidVewer[0].GetComponent <UISprite>().spriteName = "Instruction08";
            this.guidVewer[1].SetActive(false);
            this.guidVewer[2].SetActive(false);

            for (int i = 0; i < 4; i++)
            {
                player[i].GetComponent <CPlayer>().m_gauge.m_gauge = 210;
            }

            if (GetButtonCheck())
            {
                ReSetButtonCheck();
                m_soundPlayer.PlaySE("tutorial/tutorial_next");
                for (int i = 0; i < 3; i++)
                {
                    this.bloackOut[i].GetComponent <TweenAlpha>().Play(false);
                }
                this.state += 1;
            }
            break;


        case TUTORIAL_STATE.TUTORIAL5:
            this.guidVewer[0].SetActive(true);
            this.guidVewer[0].GetComponent <UISprite>().spriteName = "user'sGuide_6";
            this.guidVewer[1].SetActive(false);
            this.guidVewer[2].SetActive(false);

            for (int i = 0; i < 4; i++)
            {
                player[i].GetComponent <CPlayer>().m_gauge.m_gauge = 210;
            }

            if (GetButtonCheck())
            {
                m_soundPlayer.PlaySE("tutorial/tutorial_next");
                for (int i = 0; i < 3; i++)
                {
                    this.bloackOut[i].GetComponent <TweenAlpha>().Play(false);
                }
                this.state += 1;
            }
            break;


        case TUTORIAL_STATE.FAID_OUT:
            if (!this.bloackOut[0].GetComponent <TweenAlpha>().enabled&&
                !this.bloackOut[1].GetComponent <TweenAlpha>().enabled&&
                !this.bloackOut[2].GetComponent <TweenAlpha>().enabled)
            {
                TeamData.suppoterByTeam[0] = 0;
                TeamData.suppoterByTeam[1] = 0;
                Application.LoadLevel("MainGame");
            }
            break;
        }

        ButtonDraw();
    }
Beispiel #3
0
    //----------------------------------------------------------------------
    // 更新
    //----------------------------------------------------------------------
    // @Param   none
    // @Return  none
    // @Date    2014/10/29  @Update 2014/10/29  @Author T.Kawashita
    //          2014/11/15  @Update 2014/11/15  @Author T.Takeuchi
    //          2014/11/28  @Update 2014/11/28  @Author T.Takeuichi
    //----------------------------------------------------------------------
    void Update()
    {
        // 表示
        this.SubPanels[0, 0].transform.FindChild("NUM_Supporter_World").GetComponent <DrawNumber>().number = this.suppoterBffByWorld[0];
        this.SubPanels[0, 1].transform.FindChild("NUM_Supporter_Team0").GetComponent <DrawNumber>().number = this.suppoterBffByTeam[0, 0];
        this.SubPanels[0, 1].transform.FindChild("NUM_Supporter_Team1").GetComponent <DrawNumber>().number = this.suppoterBffByTeam[0, 1];
        this.SubPanels[1, 0].transform.FindChild("NUM_Supporter_World").GetComponent <DrawNumber>().number = this.suppoterBffByWorld[1];
        this.SubPanels[1, 1].transform.FindChild("NUM_Supporter_Team0").GetComponent <DrawNumber>().number = this.suppoterBffByTeam[1, 0];
        this.SubPanels[1, 1].transform.FindChild("NUM_Supporter_Team1").GetComponent <DrawNumber>().number = this.suppoterBffByTeam[1, 1];

        // ボタンチェック
        // 1P
        if ((Input.GetKeyDown(InputXBOX360.P1_XBOX_A) || Input.GetKeyDown(KeyCode.Alpha1)) && this.buttonCheck[0, 0] == false)
        {
            this.buttonCheck[0, 0] = true;
            m_soundPlayer.PlaySE("select/selector_select");
        }
        // 2P
        if ((Input.GetKeyDown(InputXBOX360.P2_XBOX_A) || Input.GetKeyDown(KeyCode.Alpha2)) && this.buttonCheck[0, 1] == false)
        {
            m_soundPlayer.PlaySE("select/selector_select");
            this.buttonCheck[0, 1] = true;
        }
        if ((Input.GetKeyDown(InputXBOX360.P3_XBOX_A) || Input.GetKeyDown(KeyCode.Alpha3)) && this.buttonCheck[1, 0] == false)
        {
            m_soundPlayer.PlaySE("select/selector_select");
            this.buttonCheck[1, 0] = true;
        }
        if ((Input.GetKeyDown(InputXBOX360.P4_XBOX_A) || Input.GetKeyDown(KeyCode.Alpha4)) && this.buttonCheck[1, 1] == false)
        {
            m_soundPlayer.PlaySE("select/selector_select");
            this.buttonCheck[1, 1] = true;
        }

        // デバッグ用ボタン
        this.DebugButton();


        // ボタン表示
        for (int i = 0; i < 2; i++)
        {
            for (int j = 0; j < 2; j++)
            {
                if (this.buttonCheck[i, j] == true)
                {
                    this.button[i, j].SetActive(false);
                }
                else
                {
                    this.button[i, j].SetActive(true);
                }
            }
        }
        // 遷移(左右画面共有)
        switch (this.state[0])
        {
        // 最初のフェードイン
        case RESULT_STATE.ALPHA_IN:
            if (GameObject.Find("FeedPanel").GetComponent <TweenAlpha>().enabled == false)
            {
                this.state[0] = RESULT_STATE.STAY_FIRST;
                this.state[1] = RESULT_STATE.STAY_FIRST;
                ReSetButtonCheck(0, false);
                ReSetButtonCheck(1, false);
            }
            break;

        // 最終待機
        case RESULT_STATE.STAY_LAST:
            if (this.state[0] == this.state[1])
            {
                this.state[0] = RESULT_STATE.WAIT;
                this.state[1] = RESULT_STATE.WAIT;
                this.count    = 0;
            }
            break;

        //
        case RESULT_STATE.WAIT:
            this.count++;

            if (this.count > this.countMax)
            {
                this.state[0] = RESULT_STATE.ALPHA_OUT;
                this.state[1] = RESULT_STATE.ALPHA_OUT;
                GameObject.Find("FeedPanel").GetComponent <TweenAlpha>().Play(true);
                m_soundPlayer.PlayBGMFadeOut(0.004f);
            }
            break;

        // フェードアウト
        case RESULT_STATE.ALPHA_OUT:
            if (GameObject.Find("FeedPanel").GetComponent <TweenAlpha>().enabled == false)
            {
                Application.LoadLevel("Title");
            }
            break;
        }

        // 遷移(左右画面別々)
        for (int i = 0; i < 2; i++)
        {
            switch (this.state[i])
            {
            // 待機その1
            case RESULT_STATE.STAY_FIRST:
                if (this.buttonCheck[i, 0] == true && this.buttonCheck[i, 1] == true)
                {
                    this.SubPanels[i, 1].GetComponent <TweenAlpha>().enabled = true;
                    this.state[i] = RESULT_STATE.ALPHA_TEAM_SUPPORTER;
                }
                break;

            // チームサポーターがフェードイン
            case RESULT_STATE.ALPHA_TEAM_SUPPORTER:
                if (this.SubPanels[i, 1].GetComponent <TweenAlpha>().enabled == false)
                {
                    this.state[i] = RESULT_STATE.STAY_TEAM_SUPPORTER;
                    ReSetButtonCheck(i, false);
                }
                break;

            // チームサポーターが表示状態で待機
            case RESULT_STATE.STAY_TEAM_SUPPORTER:
                if (this.buttonCheck[i, 0] == true && this.buttonCheck[i, 1] == true)
                {
                    this.SubPanels[i, 1].GetComponent <TweenPosition>().enabled = true;
                    this.state[i] = RESULT_STATE.MOVING_TEAM_SUPPORTER;
                }
                break;

            // チームサポーターが上へ移動
            case RESULT_STATE.MOVING_TEAM_SUPPORTER:
                if (this.SubPanels[i, 1].GetComponent <TweenPosition>().enabled == false)
                {
                    this.SubPanels[i, 0].GetComponent <TweenAlpha>().enabled = true;
                    this.state[i] = RESULT_STATE.ALPHA_WORLD_SUPPORTER;
                }
                break;

            // 全サポーターがフェードイン
            case RESULT_STATE.ALPHA_WORLD_SUPPORTER:
                if (this.SubPanels[0, 0].GetComponent <TweenAlpha>().enabled == false)
                {
                    this.state[i] = RESULT_STATE.ADDING_WORLD_SUPPORTER;
                    this.SubPanels[i, 0].GetComponent <TweenScale>().Play(true);
                    works[0] = this.suppoterBffByTeam[i, 0] / this.AddSuppoterTime;
                    works[1] = this.suppoterBffByTeam[i, 1] / this.AddSuppoterTime;
                }
                break;

            // 全サポーターに加算
            case RESULT_STATE.ADDING_WORLD_SUPPORTER:
                m_time += Time.deltaTime;
                //m_soundPlayer.LoopSE("result/supoter_countup");
                if (this.suppoterBffByTeam[i, 0] == 0 && this.suppoterBffByTeam[i, 1] == 0)
                {
                    this.state[i] = RESULT_STATE.STAY_TWO;
                    ReSetButtonCheck(i, false);
                    this.SubPanels[i, 0].GetComponent <TweenScale>().enabled = false;
                    m_soundPlayer.StopSE();
                }
                else
                {
                    for (int j = 0; j < 2; j++)
                    {
                        if (this.suppoterBffByTeam[i, j] >= works[j])
                        {
                            this.suppoterBffByTeam[i, j] -= works[j];
                            this.suppoterBffByWorld[i]   += works[j];
                        }
                        else if (this.suppoterBffByTeam[i, j] != 0)
                        {
                            this.suppoterBffByTeam[i, j]--;
                            this.suppoterBffByWorld[i]++;
                        }
                    }
                    if (m_time >= 0.2f)
                    {
                        m_soundPlayer.PlaySE("result/supoter_countup");
                        m_time = 0.0f;
                        // m_soundPlayer.StopSE();
                    }
                }
                break;

            // 全サポーターが加算終了し、待機中
            case RESULT_STATE.STAY_TWO:
                if (this.buttonCheck[i, 0] == true && this.buttonCheck[i, 1] == true)
                {
                    this.state[i] = RESULT_STATE.ALPHA_THANK_YOU;
                    this.SubPanels[i, 2].GetComponent <TweenAlpha>().enabled = true;
                }
                break;

            // Thank you for Playing!! がフェードイン
            case RESULT_STATE.ALPHA_THANK_YOU:
                if (this.SubPanels[i, 2].GetComponent <TweenAlpha>().enabled == false)
                {
                    this.state[i] = RESULT_STATE.STAY_LAST;
                }
                break;
            }
        }

#if false // デバッグ用スペースキーが押されたら強制的にタイトル画面へ
        if (Input.GetKeyDown(KeyCode.Space) ||
            InputXBOX360.IsGetAllStartButton())
        {
            // ここにタイトル画面に遷移する時のアニメーションを書く
            // 今は強制的に画面を遷移
            Application.LoadLevel("Title");
            Debug.Log("Title画面に遷移");
        }
#endif
    }