Esempio n. 1
0
        protected override void Awake()
        {
            base.Awake();

            AttachedPlanets = new List<Planet>();

            if (_parentTransform != null)
                SelfPlanet = _parentTransform.GetComponentInChildren<Planet>();
        }
Esempio n. 2
0
        protected override void Awake()
        {
            base.Awake();

            Planet = GetComponentInChildren<Planet>();
            Orbit = GetComponentInChildren<Orbit>();

            InitAttachOrbit();

            Planet.OnTriggerEnterAction += OnPlanetTriggerEnter;
            Planet.OnTriggerExitAction += OnPlanetTriggerExit;
            Planet.OnTriggerStayAction += OnPlanetTriggerStay;
        }
Esempio n. 3
0
File: Orbit.cs Progetto: ai-ry/orbit
 public void RemoveAttachedPlanet(Planet planet)
 {
     _attachedPlanets.Remove(planet);
     if (planet.Controller.AttachOrbit == this)
         planet.Controller.AttachOrbit = null;
 }
Esempio n. 4
0
File: Orbit.cs Progetto: ai-ry/orbit
 public void AddAttachedPlanet(Planet planet)
 {
     _attachedPlanets.Add(planet);
     planet.Controller.AttachOrbit = this;
 }