예제 #1
0
 //Remove the given object to the map hierarchy and make object selection script
 private void RemoveObjectFromMap(GameObject objectToRemove)
 {
     //Remove the object from the object selection script
     ObjectSelection.Instance.RemoveSelectable(objectToRemove);
     //Remove the object from the script dictionary
     ObjectScriptTable.Remove(objectToRemove);
     //Delete the object itself
     Destroy(objectToRemove);
 }
예제 #2
0
 //Add the given object to the map hierarchy and make it selectable
 private void AddObjectToMap(GameObject objectToAdd, MapObject objectScript)
 {
     //Make the new object a child of the map root.
     objectToAdd.transform.parent = Instance.mapRoot.transform;
     //Make the new object selectable
     ObjectSelection.Instance.AddSelectable(objectToAdd);
     //Add the object and its MapObject script to the dictionary
     ObjectScriptTable.Add(objectToAdd, objectScript);
 }