Esempio n. 1
0
        public void AttachSatellite(MovementBehaviour sattelite, MovementBehaviour parent)
        {
            Satellite satelliteBehaviour = sattelite.GetComponent <Satellite>();

            satelliteBehaviour.StartOrbiting(parent);
            var container = new SatellitesContainer
            {
                satelliteObserver = satelliteBehaviour,
                satelliteBody     = satelliteBehaviour.GetComponent <SpaceBody>(),
                gameObject        = satelliteBehaviour.gameObject,
            };

            satelliteObservers.Add(container);
            satelliteBehaviour.DeltaDistanceModify(DeltaOrbitsDistance, satelliteObservers.Count);
            sattelite.gameObject.layer =
                LayerHelper.ClassSatMap2Layer[container.satelliteBody.SpaceClass];
        }