Exemple #1
0
        protected override void Awake()
        {
            base.Awake();

            AttachedPlanets = new List<Planet>();

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

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

            InitAttachOrbit();

            Planet.OnTriggerEnterAction += OnPlanetTriggerEnter;
            Planet.OnTriggerExitAction += OnPlanetTriggerExit;
            Planet.OnTriggerStayAction += OnPlanetTriggerStay;
        }
Exemple #3
0
 public void RemoveAttachedPlanet(Planet planet)
 {
     _attachedPlanets.Remove(planet);
     if (planet.Controller.AttachOrbit == this)
         planet.Controller.AttachOrbit = null;
 }
Exemple #4
0
 public void AddAttachedPlanet(Planet planet)
 {
     _attachedPlanets.Add(planet);
     planet.Controller.AttachOrbit = this;
 }