예제 #1
0
        private void Awake()
        {
#if !UNITY_EDITOR
            Camera.main.orthographicSize *= 2.0f;
#endif

            SpaceUtil.Init();

            SpaceLarge.Init();
            SpaceSmall.Init();

            PlayButton.Init();
            Title.Init();

            Title.PositionY = SpaceUtil.WorldMap.Top.y - Title.BoxMap.Height;

            Vector2 buttonSize     = PlayButton.ButtonSize;
            Vector2 buttonSizeHalf = buttonSize * 0.5f;

            PlayButton.PositionY    = SpaceUtil.WorldMap.Center.y + buttonSizeHalf.y + ButtonOffsetHalf;
            OptionsButton.PositionY = SpaceUtil.WorldMap.Center.y - buttonSizeHalf.y - ButtonOffsetHalf;

            PlayVeryEasy.PositionY = SpaceUtil.WorldMap.Center.y + ((buttonSize.y + ButtonOffset) * 2);
            PlayEasy.PositionY     = SpaceUtil.WorldMap.Center.y + (buttonSize.y + ButtonOffset);
            PlayMedium.PositionY   = SpaceUtil.WorldMap.Center.y;
            PlayHard.PositionY     = SpaceUtil.WorldMap.Center.y - (buttonSize.y + ButtonOffset);
            PlayVeryHard.PositionY = SpaceUtil.WorldMap.Center.y - ((buttonSize.y + ButtonOffset) * 2);

            SetPlayAndOptionButtonsEnabled(true);
            SetDifficultyButtonsEnabled(false);
        }
예제 #2
0
        private void Awake()
        {
#if !UNITY_EDITOR
            Camera.main.orthographicSize *= 2.0f;
#endif

            SpaceUtil.Init();

            SpaceLarge.Init();
            SpaceSmall.Init();

            //BackButton.Init();
            Title.Init();

            Title.PositionY = SpaceUtil.WorldMap.Top.y - Title.BoxMap.Height;
            //BackButton.PositionY = SpaceUtil.WorldMap.Center.y;

            MusicVolumeSlider.Init();
            SoundEffectVolumeSlider.Init();

            Vector3 sliderOffset = new Vector3(0, OptionMargin);

            float   musicY        = Title.transform.position.y - sliderOffset.y;
            float   musicX        = SpaceUtil.WorldMap.Right.x - MusicVolumeSlider.WidthHalf;
            Vector3 musicPosition = new Vector3(musicX, musicY); // Title.transform.position - sliderOffset;
            MusicVolumeSlider.SetPosition(musicPosition);

            float   soundEffectY        = Title.transform.position.y - (sliderOffset.y * 2);
            float   soundEffectX        = musicPosition.x;
            Vector3 soundEffectPosition = new Vector3(soundEffectX, soundEffectY);
            SoundEffectVolumeSlider.SetPosition(soundEffectPosition);

            var canvas = ToggleGore.GetComponentInParent <Canvas>();
            canvas.transform.position = Vector3.zero;

            float   toggleGoreY        = Title.transform.position.y - (sliderOffset.y * 3);
            float   toggleGoreX        = musicPosition.x;
            Vector3 toggleGorePosition = new Vector3(toggleGoreX, toggleGoreY);
            ToggleGore.transform.position = toggleGorePosition;

            ToggleGore.isOn = PlayerPrefsUtil.GetBoolFromPrefs(PlayerPrefsUtil.ToggleGoreKey, false);


            //ToggleGore.transform.position = Vector3.zero;

            Vector3 cornerOffset = BackButtonMargin + BackButton.ButtonSize.ScaleX(-1.0f);
            BackButton.transform.position = SpaceUtil.WorldMap.BottomRight + cornerOffset;

            MusicVolumeSlider.Value       = PlayerPrefs.GetInt(PlayerPrefsUtil.MusicVolumeKey, 100);
            SoundEffectVolumeSlider.Value = PlayerPrefs.GetInt(PlayerPrefsUtil.SoundEffectVolumeKey, 100);

            if (!MusicManager.MusicManagerInstance.InitCalled)
            {
                MusicManager.Init();
            }

            InitPlaylists();
        }
예제 #3
0
        private void InitWithoutDependencies()
        {
#if UNITY_EDITOR
            Camera.main.orthographicSize *= 1.25f;
#else
            Camera.main.orthographicSize *= 2.0f;
#endif

            SaveUtil.InitializeSave();

            SpaceUtil.Init();

            // _ColorManager is a prefab field, and doesn't need initialized.
            _PoolManager.Init(in _ColorManager);

            WeaponResetTimer = new FrameTimer(InitialWeaponTime);
            WeaponRainTimer  = new LoopingFrameTimer(WeaponRainTime);

            OneUpRainTimer = new LoopingFrameTimer(OneUpRainTime);
            OneUpRainTimer.TimeUntilActivation = InitialOneUpRainDelay;

            _PowerupMenu.Init();
            _PowerupMenu.transform.position += new Vector3(0, 0, 0);

            VictimWasAutomatic = true;

            _GameOverGUI.Init();
            _Scoreboard.Init();

            SoundManager.Init(_AudioSource);
            SpriteBank.Init();
            NotificationManager.Init(_Notification);

            DefaultBullet.StaticInit();
            //DefaultExtraBullet.StaticInit();
            DefaultBulletBuffs.Init();

            _ParticleManager.Init();

#if !UNITY_EDITOR
            CanGameOver = true;
#else
            CanGameOver = false;
#endif
        }