示例#1
0
 void CreateInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
示例#2
0
    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();
     }
 }
示例#4
0
 // Use this for initialization
 void Start()
 {
     wsc = FindObjectOfType <WorldSceneController>();
 }