public override void Start() { if (ActorBindingID.Value == "" || ActorBindingID.Value == null) { return; } string viewID = ParentActor.ObjectViewID.ToString(); _currentView = VdsEngineSystem.Instance.GetVdsViewByID(Convert.ToInt32(viewID)); PtrClass a = ((IVdsGroupInterface)_currentView.GameLayer).GetObjectByID(ActorBindingID.Value); if (a != null) { _motioObject = a as VdsActor; } _soundEffect = new VdsEffectSound(true); _soundEffect.SoundFileName = SoundFileName.Value; _soundEffect.SoundLoop = SoundLoop.Value; _soundEffect.SoundGain = SoundGain.Value; _soundEffect.SoundPitch = SoundPitch.Value; _soundEffect.ListenerRelative = ListenerRelative.Value; _soundEffect.MaxDistance = MaxDistance.Value; _soundEffect.SoundRolloffFactor = SoundRolloffFactor.Value; _behaviourIsWorking = true; }
public override void End() { if (_currentView != null && _motioObject != null) { _soundEffect.Unapply(); _soundEffect = null; } _behaviourIsWorking = false; _currentView = null; base.End(); }