Initialize.destroyOctant C# (CSharp) Méthode

destroyOctant() public méthode

public destroyOctant ( string name, int x, int y, int z ) : void
name string
x int
y int
z int
Résultat void
    public void destroyOctant(string name, int x = 0, int y = 0, int z = 0)
    {
        // deinstantiateOctant does not automatically add minimap prefix
        GameObject entity = GameObject.Find (name);
        if (entity == null) {
            //Debug.Log("octant " + name + " does not exist.");
        } else {
            Destroy (entity);

            // Whenever there's an octant being destroyed, disable the asteroid that's in there
            List<int> octList = CommonUtility.getOctantIndicesFromVector3 (new remap.NDNMOG.DiscoveryModule.Vector3 (x + 256, y + 256, z + 256));
            for (int i = 0; i < UnityConstants.treeNum * UnityConstants.scenarioNum; i++) {
                if (inOct ((int)asteroids [i].position.x, (int)asteroids [i].position.y, (int)asteroids [i].position.z, octList)) {
                    toggleVisibility (asteroids [i], false);
                }
            }
        }
    }