// ステージ生成 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); } }
public void setStageControler(StageControler cont) { stage = cont; }
void onStageControlerLoaded(StageControler s) { if (_stageControler == null) _stageControler = s; }
void onStageControlerDestroyed(StageControler s) { if (_stageControler != s) return; _stageControler = null; }
public void OnDestroy() { dropTable = null; audioControler = null; uiControler = null; playerControler = null; inputManager = null; _instance = null; _stageControler = null; _Destroyed = true; }