Пример #1
0
    // ステージ生成
    private void Generate()
    {
        if (stageList.Last().transform.position.x >= -30)    // 最後に生成されたステージが-30を切ったら新しいものを生成
        {
            int selectStage = Random.Range(0, stagePrefabs.Length);
            //Debug.Log ("rand:" + selectStage);

            // 生成
            GameObject instanceObj = Instantiate(stagePrefabs[selectStage], new Vector3(0, 10, 0), Quaternion.identity, stageParent.transform);
            Vector3    lastPos     = stageList.Last().transform.localPosition;
            lastPos.x -= 10;

            if (selectStage <= 3)
            {
                lastPos.z = -1;
            }
            else if (selectStage >= 9)
            {
                lastPos.z = 1;
            }
            else
            {
                lastPos.z = 0;
            }
            instanceObj.transform.localPosition = lastPos;

            // 速度設定など
            StageControler ctl = instanceObj.GetComponent <StageControler> ();
            ctl.SetSpeed(stageSpeed);
            stageList.Add(instanceObj);
        }
    }
Пример #2
0
 public void setStageControler(StageControler cont)
 {
     stage = cont;
 }
Пример #3
0
 void onStageControlerLoaded(StageControler s)
 {
     if (_stageControler == null)
         _stageControler = s;
 }
Пример #4
0
    void onStageControlerDestroyed(StageControler s)
    {
        if (_stageControler != s)
            return;

        _stageControler = null;
    }
Пример #5
0
 public void OnDestroy()
 {
     
     dropTable = null;
     audioControler = null;
     uiControler = null;
     playerControler = null;
     inputManager = null;
     _instance = null;
     _stageControler = null;
     _Destroyed = true;
 }