예제 #1
0
파일: SatelliteManager.cs 프로젝트: UDK/SoV
        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];
        }