void CreateInstance() { if (instance == null) { instance = this; } }
void Start() { wsc = GameObject.Find("WorldScene").GetComponent <WorldSceneController>(); wcc = GameObject.Find("WorldControllerCanvas").GetComponent <WorldCanvasController>(); wsc.allowMove = true; GameController gc = GameObject.Find("GameController").GetComponent <GameController>(); latestLevel = gc.PlayerLastLevel; if ((latestLevel + 1) < level) { status = _status.off; } if (latestLevel > level) { status = _status.on; } if ((latestLevel + 1) == level) { status = _status.bouncing; } if (latestLevel == level) { GameObject boat = GameObject.Find("boat"); boat.transform.position = transform.position; } switch (status) { case _status.bouncing: GameObject.Instantiate(LatestLevel, transform); break; case _status.on: GameObject.Instantiate(FinishedLevel, transform); break; default: GameObject.Instantiate(UnreachedLevel, transform); break; } }
private void OnTriggerEnter(Collider other) { if (other.name == "thai_woman") { other.gameObject.SetActive(false); WorldSceneController wsc = GameObject.Find("WorldScene").GetComponent <WorldSceneController>(); wsc.DeSpawnThaiWoman(); } }
// Use this for initialization void Start() { wsc = FindObjectOfType <WorldSceneController>(); }