Example #1
0
        public override SoundResourceDefinition GetSoundResourceDefinition(TagResourceReference resourceReference)
        {
            var tagResource = GetTagResourceFromReference(resourceReference);

            if (!IsResourceValid(tagResource))
            {
                return(null);
            }

            byte[] primaryResourceData   = GetPrimaryResource(resourceReference.Gen3ResourceID);
            byte[] secondaryResourceData = GetSecondaryResource(resourceReference.Gen3ResourceID);

            if (primaryResourceData == null)
            {
                primaryResourceData = new byte[0];
            }

            if (secondaryResourceData == null)
            {
                secondaryResourceData = new byte[0];
            }

            byte[] data = new byte[primaryResourceData.Length + secondaryResourceData.Length];
            Array.Copy(primaryResourceData, 0, data, 0, primaryResourceData.Length);
            Array.Copy(secondaryResourceData, 0, data, primaryResourceData.Length, secondaryResourceData.Length);

            if (data.Length == 0)
            {
                return(null);
            }

            // does not exist in gen3, create one.
            var resourceDef = new SoundResourceDefinition
            {
                Data = new TagData(data)
            };

            return(resourceDef);
        }
Example #2
0
 public abstract TagResourceReference CreateSoundResource(SoundResourceDefinition soundResourceDefinition);
Example #3
0
 public override TagResourceReference CreateSoundResource(SoundResourceDefinition soundResourceDefinition)
 {
     return(null);
 }
 public override TagResourceReference CreateSoundResource(SoundResourceDefinition soundResourceDefinition)
 {
     return(CreateResource(soundResourceDefinition, ResourceLocation.Audio, TagResourceTypeGen3.Sound));
 }