コード例 #1
0
    // Use this for initialization
    void Start()
    {
        ok.SetActive(false);
        wc   = GetComponent <WarnController> ();
        bait = GetComponent <Bait> ();
        Para p = GameController.db.getPara(GameController.curLevel);

        bait.setLevel(p);
        isBaiting = false;
        isFishing = false;
        isSuccess = false;
        for (int i = 0; i < numFish; i++)
        {
            Vector3 pos = new Vector3(Random.Range(xMin, xMax),
                                      Random.Range(yMin, yMax),
                                      Random.Range(zMin, zMax));
            allFish [i] = (GameObject)Instantiate(fishPrefab, pos, Quaternion.identity);
            flock_Island f = allFish [i].GetComponent <flock_Island> ();
            f.id = i;
            float scale = Random.Range(0.4f, 0.6f);
            allFish [i].transform.localScale = new Vector3(scale, scale, scale);
            f.scale = scale;
        }
        goalPos = goalPrefab.transform.position;
        m_timer = 0;
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        ok.SetActive(false);
        wc   = GetComponent <WarnController> ();
        bait = GetComponent <Bait> ();
        Para p = GameController.db.getPara(GameController.curLevel);

        bait.setLevel(p);
        isBaiting = false;
        isFishing = false;
        isSuccess = false;
        for (int i = 0; i < numFish; i++)
        {
            Vector3 pos = new Vector3(Random.Range(xMin, xMax),
                                      Random.Range(yMin, yMax),
                                      Random.Range(zMin, zMax));
            allFish [i] = (GameObject)Instantiate(fishPrefab, pos, Quaternion.identity);
            flock_Creek f = allFish [i].GetComponent <flock_Creek> ();
            f.id = i;
            float scale = Random.Range(0.2f, 0.6f);
            allFish [i].transform.localScale = new Vector3(scale, scale, scale);
            f.scale = scale;
        }
        goalPos = goalPrefab.transform.position;
        m_timer = 0;
        //Debug.Log ("goalPos: (" + goalPos.x + ", " + goalPos.y + ", " + goalPos.z + ")!");

        /*GameController.db = new DataAccess ();
         * GameController.curLevel = GameController.db.getUserLevel (GameController.username);
         * GameController.curScore = GameController.db.getUserScore (GameController.username);
         * GameController.curNumFish = 0;*/
    }