public Nodule SpawnNodule(Vector3 pos, Quaternion rot, NoduleType type) { var nod = m_Nodules.SpawnNodule(pos, rot, type); OctreeManager.Get(OctreeType.Nodule).Add(nod.transform); return(nod); }
public Nodule SpawnNodule(Vector3 pos, Quaternion rot, NoduleType type) { //Check for a disabled nodule of the right type foreach (var id in m_DisabledIDs.ToList()) { if (m_Nodules[id].Type == type) { return(EnableNodule(pos, rot, id)); } } var nod = SpawnNoduleController(pos, rot, type); Add(nod); return(nod); }
private Nodule InternalInstantiateNodule(Vector3 pos, Quaternion rot, NoduleType type) { switch (type) { case NoduleType.Floating: return(((GameObject)Instantiate(FloatingNodulePrefab, pos, rot)).GetComponent <Nodule>()); case NoduleType.Snatcher: return(((GameObject)Instantiate(SnatcherNodulePrefab, pos, rot)).GetComponent <Nodule>()); case NoduleType.SporeGun: return(((GameObject)Instantiate(SporeGunNodulePrefab, pos, rot)).GetComponent <Nodule>()); } throw new ArgumentException("Unrecognized type: " + type); }
public static Nodule InstantiateNodule(Vector3 pos, Quaternion rot, NoduleType type) { return(Singleton.InternalInstantiateNodule(pos, rot, type)); }