Esempio n. 1
0
        // Use this for initialization
        void Start()
        {
            texture = SelectManager.instance.GetTexture();

            numButtons = texture.Length;

            float btnHeight = 0;

            for (int i = 0; i < numButtons; i++)
            {
                // 作成
                GameObject    button    = Instantiate(buttonPrefab) as GameObject;
                RectTransform rectTrans = button.GetComponent <RectTransform>();
                // 作成したオブジェクトを子として登録
                rectTrans.SetParent(content.GetComponent <RectTransform>());
                //テキスト情報を変更
                int stagenum = i + 1;
                button.transform.GetChild(1).GetComponentInChildren <Text>().text = "STAGE " + stagenum.ToString();
                PlayStage stage = (PlayStage)(stagenum - 1);
                string    time  = Timer.ConvertStringTime(PlayerPrefs.GetFloat(stage.ToString() + "Time", 0.0f));
                button.transform.GetChild(2).GetComponentInChildren <Text>().text = "Best " + time;
                btnHeight = rectTrans.sizeDelta.y;
                rectTrans.localPosition = new Vector2(0, -btnHeight * i - margin * (1 + i));
                // スケールを等倍に
                button.transform.localScale = new Vector3(1, 1, 1);

                button.GetComponent <StageButton>().m_stage = (PlayStage)i;
                button.transform.GetChild(0).GetComponent <Image>().sprite = Sprite.Create(texture[i], new Rect(0.0f, 0.0f, texture[i].width, texture[i].height), new Vector2(0.5f, 0.5f));
            }
            //器であるcontentオブジェクトの高さを、内包するボタンの数に応じて伸長する
            RectTransform contentRectTrans = content.GetComponent <RectTransform>();

            contentRectTrans.sizeDelta = new Vector2(GetComponent <RectTransform>().sizeDelta.x, btnHeight * numButtons + margin * (numButtons + 1));
        }
Esempio n. 2
0
        public MainGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            this.GameInfo       = new GameInfo();
            this.DownInfo       = new DownInfo();
            this.Teams          = new Team[NUM_SIDES];
            this.Sides          = new Side[NUM_SIDES];
            this.CurrentPlay    = new Play[NUM_SIDES];
            this.Playbook       = new Playbook[NUM_SIDES];
            this.ObjectDispList = new DisplayList();
            this.ShadowDispList = new DisplayList();
            this.VPads          = new VPad[NUM_SIDES];
            this.MsgMgr         = new MessageManager();

            this.BeginGameStage      = new BeginGameStage(this);
            this.CheckTimeStage      = new CheckTimeStage(this);
            this.CoinTossStage       = new CoinTossStage(this);
            this.EndGameStage        = new EndGameStage(this);
            this.FirstDownStage      = new FirstDownStage(this);
            this.HalfTimeStage       = new HalfTimeStage(this);
            this.PlayStage           = new PlayStage(this);
            this.SelectGameModeStage = new SelectGameModeStage(this);
            this.SelectInputStage    = new SelectInputStage(this);
            this.SelectPlayStage     = new SelectPlayStage(this);
            this.SelectTeamStage     = new SelectTeamStage(this);
            this.TitleScreenStage    = new TitleScreenStage(this);
            this.TouchdownStage      = new TouchdownStage(this);
            this.TurnOverStage       = new TurnOverStage(this);
        }
Esempio n. 3
0
        public override void SceneChange(int select)
        {
            select = select % System.Enum.GetValues(typeof(PlayStage)).Length;
            PlayStage change = (PlayStage)select;

            // プレイインストラクターにシーンを設定!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            PlayInstructor.m_nextScene = change;

            // 次のシーンに移動
            SceneInstructor.instance.LoadMainScene(GameScene.Play);
        }
Esempio n. 4
0
        protected virtual void InitStages()
        {
            StartStage = FindObjectOfType <LevelStartStage>();
            StartStage.Init();

            PlayStage = FindObjectOfType <LevelPlayStage>();
            PlayStage.Init();

            EndStage = FindObjectOfType <LevelEndStage>();
            EndStage.Init();
        }
Esempio n. 5
0
 // ステージをロードする
 public void LoadStage(PlayStage stage)
 {
     if (m_initFlag == false)
     {
         ShunLib.GameOverDirection.instance.Initialize(); // オーバーの初期化
         ShunLib.ClearDirection.instance.Initialize();    // クリアの初期化
         SceneManager.UnloadSceneAsync(((PlayStage)m_loadStage).ToString());
     }
     else
     {
         m_initFlag = false;
     }
     SceneManager.LoadScene(stage.ToString(), LoadSceneMode.Additive);
     m_lastStage = m_loadStage;
     m_loadStage = (int)stage;
     SelectManager.SceneSave((int)stage);
 }
Esempio n. 6
0
 public void ChangeStage(PlayStage changeTo)
 {
     currentStage = changeTo;
     SetDotAndNumber(0);
 }
Esempio n. 7
0
 public void UpdateStage(PlayStage newStage)
 {
     Stage = newStage;
 }
Esempio n. 8
0
        // Update is called once per frame
        void Update()
        {
            PlayStage nowStage = PlayInstructor.instance.GetLoadStage();

            if (nowStage != m_loadStage)
            {
                // シーンが変わったら
                // シーンを記憶
                m_loadStage = nowStage;

                PlayBGM nowBGM = m_loadBGM;

                switch (m_loadStage)
                {
                case PlayStage.Stage1:
                case PlayStage.Stage2:
                case PlayStage.Stage3:
                case PlayStage.Stage4:
                case PlayStage.Stage5:
                    AudioManager.Instance.AudioSet(PlayBGM.Play_01.ToString(), "MP3\\1to5");
                    AudioManager.Instance.SetOption(PlayBGM.Play_01.ToString(), true, false);
                    m_loadBGM = PlayBGM.Play_01;
                    break;

                case PlayStage.Stage6:
                case PlayStage.Stage7:
                case PlayStage.Stage8:
                case PlayStage.Stage9:
                case PlayStage.Stage10:
                    AudioManager.Instance.AudioSet(PlayBGM.Play_02.ToString(), "MP3\\6to10");
                    AudioManager.Instance.SetOption(PlayBGM.Play_02.ToString(), true, false);
                    m_loadBGM = PlayBGM.Play_02;
                    break;

                case PlayStage.Stage11:
                case PlayStage.Stage12:
                case PlayStage.Stage13:
                case PlayStage.Stage14:
                case PlayStage.Stage15:
                    AudioManager.Instance.AudioSet(PlayBGM.Play_03.ToString(), "MP3\\11to15");
                    AudioManager.Instance.SetOption(PlayBGM.Play_03.ToString(), true, false);
                    m_loadBGM = PlayBGM.Play_03;
                    break;

                case PlayStage.Stage16:
                case PlayStage.Stage17:
                case PlayStage.Stage18:
                case PlayStage.Stage19:
                    AudioManager.Instance.AudioSet(PlayBGM.Play_04.ToString(), "MP3\\16to19");
                    AudioManager.Instance.SetOption(PlayBGM.Play_04.ToString(), true, false);
                    m_loadBGM = PlayBGM.Play_04;
                    break;

                case PlayStage.Stage20:
                    AudioManager.Instance.AudioSet(PlayBGM.Play_05.ToString(), "MP3\\20");
                    AudioManager.Instance.SetOption(PlayBGM.Play_05.ToString(), true, false);
                    m_loadBGM = PlayBGM.Play_05;
                    break;

                default:
                    m_loadBGM = PlayBGM.NONE;
                    break;
                }

                if ((m_loadBGM != nowBGM) && (m_loadBGM != PlayBGM.NONE))
                {
                    if (nowBGM != PlayBGM.NONE)
                    {
                        StartCoroutine(AudioManager.Instance.fadeOut(nowBGM.ToString(), 3.0f));
                    }
                    StartCoroutine(AudioManager.Instance.fadeIn(m_loadBGM.ToString(), 3.0f, 1.5f));
                }
            }
        }
Esempio n. 9
0
        // Use this for initialization
        void Start()
        {
            m_loadStage = (PlayStage)System.Enum.GetValues(typeof(PlayStage)).Length;

            m_loadBGM = PlayBGM.NONE;
        }