コード例 #1
0
    // Use this for initialization
    void Awake()
    {
        areamanref = GetComponent <areamanager>();
        for (int i = 1; i <= poolareacount; i++)
        {
            Vector3 vec3;
            vec3.x = Random.Range(randomXmin, randomXmax);
            vec3.y = Random.Range(randomymin, randomymax);
            vec3.z = Random.Range(randomZmin, randomZmax);

            GameObject enemypoolarea = Instantiate(poolareaobj, transform.position, transform.rotation) as GameObject;
            enemypoolarea.transform.SetParent(transform);
            enemypoolarea.transform.localPosition = vec3;
            poolareas.Add(enemypoolarea.transform);
            //		print("made and moved");
        }

        StartCoroutine(enemyreleasewait());
    }
コード例 #2
0
 void Awake()
 {
     coll   = GetComponent <Collider>();
     manref = GetComponentInParent <areamanager>();
     manref.locks.Add(GetComponent <basicLock>());
 }