示例#1
0
 public void Init(PlanetConfig config, Transform sun)
 {
     _config = config;
     _lifes  = config.Life;
     _orbit.Init(config.EllipsePosition.x, config.EllipsePosition.y, config.OrbitSpeed, config.YOffset, config.RotateClockwise, sun);
     _axisRotation.Init(config.AxisSpeed);
     SetScale(config.Diameter);
 }
示例#2
0
        private Planet GeneratePlanet(PlanetConfig planetConfig)
        {
            Planet planet = Instantiate(planetConfig.Pref, Vector3.zero, Quaternion.identity, this.transform).GetComponent <star_system.Planet>();

            planet.Init(planetConfig, _sun);

            if (planetConfig.PlayerPlanet)
            {
                _playerLauncher = planet.gameObject.GetComponent <MissileLauncher>();
            }

            return(planet);
        }