public int natureOfOrb;//0 fire, 1 lightning, 2 nothing void OnEnable() { if (natureOfOrb == 0) { orbInside = Instantiate(OrbManagerScript.getProviderStationaryF(), transform.position + Vector3.up, Quaternion.identity); orbInside.transform.SetParent(gameObject.transform); } else if (natureOfOrb == 1) { orbInside = Instantiate(OrbManagerScript.getProviderStationaryL(), transform.position + Vector3.up, Quaternion.identity); orbInside.transform.SetParent(gameObject.transform); } }
void Throw() { stationaryOrb.SendMessage("RemoveSelf"); if (natureOfOrb == 0) { shotOrb = Instantiate(OrbManagerScript.getPlayerShotF(), orbPoint, Quaternion.identity); } else { shotOrb = Instantiate(OrbManagerScript.getPlayerShotL(), orbPoint, Quaternion.identity); } shotOrb.transform.forward = transform.forward; shotOrb.SendMessage("Fly"); natureOfOrb = 10; }
void Catch(int nature) { if (natureOfOrb == 10) { natureOfOrb = nature; if (natureOfOrb == 0) { stationaryOrb = Instantiate(OrbManagerScript.getPlayerHeldF(), orbPoint, Quaternion.identity); } else { stationaryOrb = Instantiate(OrbManagerScript.getPlayerHeldL(), orbPoint, Quaternion.identity); } stationaryOrb.transform.parent = transform.GetChild(0).transform; } }
void Send() { switch (natureOfOrb) { case 0: sentOrb = Instantiate(OrbManagerScript.getProviderSentF(), transform.position + Vector3.up, Quaternion.identity); SetFree(); break; case 1: sentOrb = Instantiate(OrbManagerScript.getProviderSentL(), transform.position + Vector3.up, Quaternion.identity); SetFree(); break; default: break; } }
void GetOrbed(int nature) { if (natureOfOrb == 10) { //Send(); natureOfOrb = nature; switch (natureOfOrb) { case 0: orbInside = Instantiate(OrbManagerScript.getProviderStationaryF(), transform.position + Vector3.up, Quaternion.identity); break; case 1: orbInside = Instantiate(OrbManagerScript.getProviderStationaryL(), transform.position + Vector3.up, Quaternion.identity); break; default: orbInside = Instantiate(OrbManagerScript.getProviderStationaryF(), transform.position + Vector3.up, Quaternion.identity); break; } orbInside.transform.SetParent(gameObject.transform); } }
void Awake() { instance = this; }