private void Parse(Stream s) { var br = new BinaryStreamWrapper(s); br.ByteOrder = ByteOrder.BigEndian; mId = (SoundProperty)br.ReadUInt32(); mTypeCode = (DataType)br.ReadUInt16(); mRepCode = br.ReadUInt16(); var data = new List <TypedData>(); if (!HasTypeData) { data.Add(ReadTypedData(0, handler, mTypeCode, s)); } else { int count = br.ReadInt32(); int itemSize = br.ReadInt32(); if (itemSize != ItemSize) { throw new InvalidDataException(String.Format("Bad item size: Expected {0}, but got {1}", ItemSize, itemSize)); } for (int i = 0; i < count; i++) { data.Add(ReadTypedData(0, handler, mTypeCode, s)); } } mItems = new DataList(handler, data, this); }
public DataBlock(int APIversion, EventHandler handler, DataType typeCode, ushort repCode, SoundProperty id, IEnumerable <TypedData> items) : this(APIversion, handler) { mTypeCode = typeCode; mRepCode = repCode; mId = id; mItems.AddRange(items.Select(x => x.Clone(handler)).Cast <TypedData>()); }
public void SwapSounds(GameObject from, GameObject to) { particleSwapFeedback.SwapParticleFeedback(from, to); SoundProperty temp = from.GetComponent <SoundContainer>().Sound; from.GetComponent <SoundContainer>().Sound = to.GetComponent <SoundContainer>().Sound; to.GetComponent <SoundContainer>().Sound = temp; print($"swapping sounds from {from.name} to {to.name}"); LevelContainerManager.Instance.CheckWin(); }
public void UpdateProperty(SoundProperty soundProperty, SoundType soundType) { if (!soundProperties.ContainsKey(soundType)) { soundProperties.Add(soundType, null); } soundProperties[soundType] = soundProperty; if (playingSources.ContainsKey(soundType)) { foreach (SoundSource soundSource in playingSources[soundType]) { soundSource.UpdateProperty(soundProperty); } } }
/// <summary> /// This is overridden to allow copying of the additional properties /// </summary> /// <param name="p">The PDI object from which the settings are to be copied</param> protected override void Clone(PDIObject p) { VCard o = (VCard)p; this.ClearProperties(); groupName = o.Group; fn = (FormattedNameProperty)o.FormattedName.Clone(); name = (NameProperty)o.Name.Clone(); title = (TitleProperty)o.Title.Clone(); role = (RoleProperty)o.Role.Clone(); mailer = (MailerProperty)o.Mailer.Clone(); url = (UrlProperty)o.Url.Clone(); org = (OrganizationProperty)o.Organization.Clone(); uid = (UniqueIdProperty)o.UniqueId.Clone(); bday = (BirthDateProperty)o.BirthDate.Clone(); rev = (LastRevisionProperty)o.LastRevision.Clone(); tz = (TimeZoneProperty)o.TimeZone.Clone(); geo = (GeographicPositionProperty)o.GeographicPosition.Clone(); key = (PublicKeyProperty)o.PublicKey.Clone(); photo = (PhotoProperty)o.Photo.Clone(); logo = (LogoProperty)o.Logo.Clone(); sound = (SoundProperty)o.Sound.Clone(); this.Notes.CloneRange(o.Notes); this.Addresses.CloneRange(o.Addresses); this.Labels.CloneRange(o.Labels); this.Telephones.CloneRange(o.Telephones); this.EMailAddresses.CloneRange(o.EMailAddresses); this.Agents.CloneRange(o.Agents); this.CustomProperties.CloneRange(o.CustomProperties); addProfile = o.AddProfile; mimeName = (MimeNameProperty)o.MimeName.Clone(); mimeSource = (MimeSourceProperty)o.MimeSource.Clone(); prodId = (ProductIdProperty)o.ProductId.Clone(); nickname = (NicknameProperty)o.Nickname.Clone(); sortString = (SortStringProperty)o.SortString.Clone(); classification = (ClassificationProperty)o.Classification.Clone(); categories = (CategoriesProperty)o.Categories.Clone(); }
/// <summary> /// The method can be called to clear all current property values from the vCard. The version is left /// unchanged. /// </summary> public void ClearProperties() { groupName = null; fn = null; name = null; title = null; role = null; mailer = null; url = null; org = null; uid = null; bday = null; rev = null; tz = null; geo = null; key = null; photo = null; logo = null; sound = null; notes = null; addrs = null; labels = null; phones = null; email = null; agents = null; customProps = null; addProfile = false; mimeName = null; mimeSource = null; prodId = null; nickname = null; sortString = null; classification = null; categories = null; }
public void Play() { if (started) { if (paused) { Resume(); } else { Debug.LogError("Already Playing! ", this); } return; } if (soundClip == null || soundSystem == null || soundClip.audioClip == null) { Debug.LogError("Asked for playing SoundSource, but no null is given! ", this); Destroy(this); return; } // Create Sound Source audioSource = soundClip.GetSourceObject().AddComponent <AudioSource>(); audioSource.clip = soundClip.audioClip; audioSource.loop = loopPlay; // Apply Sound Property soundProperty = soundSystem.GetProperty(soundType); UpdateAudioSource(); // Start Playing soundSystem.AddPlayingSource(this); audioSource.Play(); started = true; }
public void UpdateProperty(SoundProperty soundProperty) { this.soundProperty = soundProperty; UpdateAudioSource(); }