Example #1
0
        void Start()
        {
            dfUnity    = DaggerfallUnity.Instance;
            songPlayer = GetComponent <DaggerfallSongPlayer>();

            // Get local player GPS if not set
            if (LocalPlayerGPS == null)
            {
                LocalPlayerGPS = GameManager.Instance.PlayerGPS;
            }

            // Get streaming world if not set
            if (StreamingWorld == null)
            {
                StreamingWorld = GameManager.Instance.StreamingWorld;
            }

            // Get required player components
            if (LocalPlayerGPS)
            {
                playerEnterExit = LocalPlayerGPS.GetComponent <PlayerEnterExit>();
                playerWeather   = LocalPlayerGPS.GetComponent <PlayerWeather>();
            }

            // Shuffle song on load or fast travel
            StreamingWorld.OnInitWorld += StreamingWorld_OnInitWorld;
        }
Example #2
0
        void Start()
        {
            dfUnity    = DaggerfallUnity.Instance;
            songPlayer = GetComponent <DaggerfallSongPlayer>();

            // Get local player GPS if not set
            if (LocalPlayerGPS == null)
            {
                LocalPlayerGPS = GameManager.Instance.PlayerGPS;
            }

            // Get player entity
            if (playerEntity == null)
            {
                playerEntity = GameManager.Instance.PlayerEntity;
            }

            // Get streaming world if not set
            if (StreamingWorld == null)
            {
                StreamingWorld = GameManager.Instance.StreamingWorld;
            }

            // Get required player components
            if (LocalPlayerGPS)
            {
                playerEnterExit = LocalPlayerGPS.GetComponent <PlayerEnterExit>();
                playerWeather   = LocalPlayerGPS.GetComponent <PlayerWeather>();
            }
        }
Example #3
0
        void Start()
        {
            dfUnity    = DaggerfallUnity.Instance;
            songPlayer = GetComponent <DaggerfallSongPlayer>();

            // Get local player GPS if not set
            if (LocalPlayerGPS == null)
            {
                LocalPlayerGPS = GameManager.Instance.PlayerGPS;
            }

            // Get player entity
            if (playerEntity == null)
            {
                playerEntity = GameManager.Instance.PlayerEntity;
            }

            // Get streaming world if not set
            if (StreamingWorld == null)
            {
                StreamingWorld = GameManager.Instance.StreamingWorld;
            }

            // Get required player components
            if (LocalPlayerGPS)
            {
                playerEnterExit = LocalPlayerGPS.GetComponent <PlayerEnterExit>();
                playerWeather   = LocalPlayerGPS.GetComponent <PlayerWeather>();
            }

            // Use alternate music if set
            if (DaggerfallUnity.Settings.AlternateMusic)
            {
                DungeonInteriorSongs = _dungeonSongsFM;
                SunnySongs           = _sunnySongsFM;
                CloudySongs          = _cloudySongsFM;
                OvercastSongs        = _overcastSongsFM;
                RainSongs            = _weatherRainSongsFM;
                SnowSongs            = _weatherSnowSongsFM;
                TempleSongs          = _templeSongsFM;

                TavernSongs = new SongFiles[_tavernSongs.Length + _tavernSongsFM.Length];
                Array.Copy(_tavernSongs, TavernSongs, _tavernSongs.Length);
                Array.Copy(_tavernSongsFM, 0, TavernSongs, _tavernSongs.Length, _tavernSongsFM.Length);

                NightSongs      = _nightSongsFM;
                ShopSongs       = _shopSongsFM;
                MagesGuildSongs = _magesGuildSongsFM;
                InteriorSongs   = _interiorSongsFM;
                PalaceSongs     = _palaceSongsFM;
                CastleSongs     = _castleSongsFM;
                CourtSongs      = _courtSongsFM;
                SneakingSongs   = _sneakingSongsFM;
            }

            PlayerEnterExit.OnTransitionDungeonInterior += PlayerEnterExit_OnTransitionDungeonInterior;
            PlayerEnterExit.OnTransitionInterior        += PlayerEnterExit_OnTransitionInterior;
        }
        void Start()
        {
            dfUnity    = DaggerfallUnity.Instance;
            songPlayer = GetComponent <DaggerfallSongPlayer>();

            // Try to find local player GPS if not set
            if (LocalPlayerGPS == null)
            {
                GameObject player = GameObject.FindGameObjectWithTag("Player");
                if (player)
                {
                    LocalPlayerGPS = player.GetComponent <PlayerGPS>();
                }
            }

            // Get required player components
            if (LocalPlayerGPS)
            {
                playerEnterExit = LocalPlayerGPS.GetComponent <PlayerEnterExit>();
                playerWeather   = LocalPlayerGPS.GetComponent <PlayerWeather>();
            }
        }
        void Start()
        {
            dfUnity = DaggerfallUnity.Instance;
            songPlayer = GetComponent<DaggerfallSongPlayer>();

            // Get local player GPS if not set
            if (LocalPlayerGPS == null)
                LocalPlayerGPS = GameManager.Instance.PlayerGPS;

            // Get streaming world if not set
            if (StreamingWorld == null)
                StreamingWorld = GameManager.Instance.StreamingWorld;

            // Get required player components
            if (LocalPlayerGPS)
            {
                playerEnterExit = LocalPlayerGPS.GetComponent<PlayerEnterExit>();
                playerWeather = LocalPlayerGPS.GetComponent<PlayerWeather>();
            }
        }
Example #6
0
        void Start()
        {
            dfUnity = DaggerfallUnity.Instance;
            songPlayer = GetComponent<DaggerfallSongPlayer>();

            // Try to find local player GPS if not set
            if (LocalPlayerGPS == null)
            {
                GameObject player = GameObject.FindGameObjectWithTag("Player");
                if (player)
                {
                    LocalPlayerGPS = player.GetComponent<PlayerGPS>();
                }
            }

            // Get required player components
            if (LocalPlayerGPS)
            {
                playerEnterExit = LocalPlayerGPS.GetComponent<PlayerEnterExit>();
                playerWeather = LocalPlayerGPS.GetComponent<PlayerWeather>();
            }
        }