Exemple #1
0
        public void OnSpawned(PlanetModel model, IMemoryPool pool)
        {
            _planetModel         = model;
            _pool                = pool;
            _currentAngleToSun   = model.CurrentAngleToSun;
            transform.localScale = new Vector3(model.Settings.planetScale, model.Settings.planetScale,
                                               model.Settings.planetScale);
            _currentHud            = _hudFactory.Create();
            _currentRocketSettings = _rocketSettingsList[0];
            _isDead = false;
            _planetModel.SetNickname(model.Nickname);
            GetComponent <MeshRenderer>().material.color = model.Color;
            if (string.IsNullOrEmpty(model.Nickname))
            {
                _planetModel.SetNickname(NickGenerator.GetRandomNickname());
            }

            _currentHud.Configure(_planetModel.Nickname, model.IsPlayer, _gameSettings.initialPlanetHP, model.Hp);
        }