コード例 #1
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();
        }