コード例 #1
0
    void InstantiatePrefab()
    {
        Vector3    prefabPosition = new Vector3(0, 0, 0);
        GameObject newGameObject;

        if (RandomLocation == true)
        {
            prefabPosition = GenerateRandomPosition();
        }

        newGameObject = Instantiate(PrefabToSpawn, prefabPosition, Quaternion.identity);
        CollisionTestSphere colTestInstance = newGameObject.GetComponent <CollisionTestSphere>();

        if (colTestInstance != null)
        {
            colTestInstance.mySpawner = this;
            colTestSpheres.Add(colTestInstance);
        }
    }
コード例 #2
0
 public void RemoveMe(CollisionTestSphere colTestInstance)
 {
     colTestSpheres.Remove(colTestInstance);
 }