Ejemplo n.º 1
0
            // 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();
            }
Ejemplo n.º 2
0
 // Runtime constructor
 public CoronaLoader(SunCoronas component)
 {
     coronaComponent = component;
     corona = component.gameObject;
 }
Ejemplo n.º 3
0
 // Runtime constructor
 public CoronaLoader(SunCoronas component)
 {
     coronaComponent = component;
     corona          = component.gameObject;
 }
Ejemplo n.º 4
0
            // 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();
            }