// Default constructor public CoronaLoader() { // We need to get the body for the Sun (to steal it's corona mesh) PSystemBody sun = Utility.FindBody(PSystemManager.Instance.systemPrefab.rootBody, "Sun"); // Clone a default Corona corona = UnityEngine.Object.Instantiate(sun.scaledVersion.GetComponentsInChildren <SunCoronas>(true).First().gameObject) as GameObject; corona.transform.parent = Utility.Deactivator; coronaComponent = corona.GetComponent <SunCoronas> (); // Setup the material loader material = new ParticleAddSmoothLoader(corona.GetComponent <Renderer>().material); material.name = Guid.NewGuid().ToString(); }
// Runtime constructor public CoronaLoader(SunCoronas component) { coronaComponent = component; corona = component.gameObject; }
// Runtime constructor public CoronaLoader(SunCoronas component) { coronaComponent = component; corona = component.gameObject; }
// Default constructor public CoronaLoader() { // We need to get the body for the Sun (to steal it's corona mesh) PSystemBody sun = Utility.FindBody (PSystemManager.Instance.systemPrefab.rootBody, "Sun"); // Clone a default Corona corona = UnityEngine.Object.Instantiate(sun.scaledVersion.GetComponentsInChildren<SunCoronas>(true).First().gameObject) as GameObject; corona.transform.parent = Utility.Deactivator; coronaComponent = corona.GetComponent<SunCoronas> (); // Setup the material loader material = new ParticleAddSmoothLoader (corona.GetComponent<Renderer>().material); material.name = Guid.NewGuid().ToString(); }