コード例 #1
0
ファイル: Cutscene.cs プロジェクト: RoadTrain/Mafia2Toolkit
            public void WriteToFile(BinaryWriter Writer)
            {
                StringHelpers.WriteString16(Writer, CutsceneName);
                Writer.Write(unk05);
                Writer.Write(gcsSize);
                AssetContent.WriteToFile(Writer);

                if (SoundContent != null)
                {
                    Writer.Write(true); // Has SPD
                    SoundContent.WriteToFile(Writer);
                }

                // TODO: Not sure if this is fully valid or not..
                if (VehicleContent != null && VehicleContent.Length > 0)
                {
                    Writer.Write(VehicleContent.Length); // Num GCR

                    foreach (GCRData VehicleData in VehicleContent)
                    {
                        VehicleData.WriteToFile(Writer);
                    }
                }
                else
                {
                    Writer.Write(0);
                }
            }
コード例 #2
0
            public void WriteToFile(BinaryWriter Writer)
            {
                StringHelpers.WriteString16(Writer, CutsceneName);
                Writer.Write(unk05);
                Writer.Write(gcsSize);
                AssetContent.WriteToFile(Writer);

                if (SoundContent != null)
                {
                    Writer.Write(true); // Has SPD
                    SoundContent.WriteToFile(Writer);
                }

                Writer.Write(0); // Num GCR
            }
コード例 #3
0
        public SoundContent AddSoundEffect(string name)
        {
            SoundContent sound = new SoundContent(name);

            if (!_sounds.Contains(sound))
            {
                _sounds.Add(sound);
                return(sound);
            }
            _sounds.Add(sound);

            int index = _sounds.IndexOf(sound);

            return(_sounds[index]);
        }
コード例 #4
0
 void LoadSoundEffects(ContentManager content)
 {
     for (int i = currentSoundCount; i < _sounds.Count; i++)
     {
         if (_sounds[i] != null)
         {
             SoundContent sound = _sounds[i];
             try
             {
                 sound.Sound = content.Load <SoundEffect>(sound.Name);
             }
             catch (Exception e)
             {
             }
         }
         currentSoundCount++;
     }
 }
コード例 #5
0
 public void AddSoundContent(SoundContent soundPack)
 {
     _sounds.Add(soundPack);
 }