protected override void Awake() { base.Awake(); AttachedPlanets = new List<Planet>(); if (_parentTransform != null) SelfPlanet = _parentTransform.GetComponentInChildren<Planet>(); }
protected override void Awake() { base.Awake(); Planet = GetComponentInChildren<Planet>(); Orbit = GetComponentInChildren<Orbit>(); InitAttachOrbit(); Planet.OnTriggerEnterAction += OnPlanetTriggerEnter; Planet.OnTriggerExitAction += OnPlanetTriggerExit; Planet.OnTriggerStayAction += OnPlanetTriggerStay; }
public void RemoveAttachedPlanet(Planet planet) { _attachedPlanets.Remove(planet); if (planet.Controller.AttachOrbit == this) planet.Controller.AttachOrbit = null; }
public void AddAttachedPlanet(Planet planet) { _attachedPlanets.Add(planet); planet.Controller.AttachOrbit = this; }