示例#1
0
        private static void PlayGroup(int startId, int endId, ref ISound instance, Vehicle vehicle)
        {
            if (instance != null && instance.IsPlaying && instance.Owner != vehicle)
            {
                if (vehicle.Driver is PlayerDriver)  //priority
                {
                    instance.Reset();
                }
                else if (((Vehicle)instance.Owner).Driver is PlayerDriver)
                {
                    return; //dont steal player's sound
                }
            }

            if (instance == null || !instance.IsPlaying)
            {
                int id = Engine.Random.Next(startId, endId + 1);
                instance = Play(id, vehicle, true);
            }
        }
示例#2
0
        private static void PlayGroup(int startId, int endId, ref ISound instance, Vehicle vehicle)
        {
            if (instance != null && instance.IsPlaying && instance.Owner != vehicle)
            {
                if (vehicle.Driver is PlayerDriver)  //priority
                    instance.Reset();
                else if (((Vehicle)instance.Owner).Driver is PlayerDriver)
                {
                    return; //dont steal player's sound
                }
            }

            if (instance == null || !instance.IsPlaying)
            {
                int id = Engine.Random.Next(startId, endId+1);
                instance = Play(id, vehicle, true);
            }
        }