29 private float m_fTime = 30;
31 private ref array<ref SCR_MoveData> m_aMoveData =
new array<ref SCR_MoveData>;
34 void PlayMoveSound(
float timeSlice)
46 Math3D.MatrixIdentity4(mat);
47 mat[3] = moveData.m_vPosition;
54 m_aMoveData.Insert(moveData);
63 this.
GetWorld().GetCurrentCamera(mat);
64 vector cameraPosition = mat[3];
69 int side =
Math.RandomIntInclusive(0, 1);
77 A[0] = trajectoryDistance;
78 B[0] = trajectoryDistance;
82 A[2] = cameraPosition[2] + trajectoryLenght;
83 B[2] = cameraPosition[2] - trajectoryLenght;
94 velocity /= moveData.m_fOveralMoveTime;
96 moveData.m_vPosition = A;
97 moveData.m_vVelocity = velocity;
103 void UpdateFlySoundPosition(
float timeSlice)
105 int count = m_aMoveData.Count();
112 for (
int i = count; i >= 0; i--)
114 SCR_MoveData moveData = m_aMoveData[i];
117 if (AudioSystem.IsSoundPlayed(moveData.m_AudioHandle))
119 m_aMoveData.Remove(i);
123 moveData.m_fMoveTime += timeSlice;
126 if(moveData.m_fMoveTime >= moveData.m_fOveralMoveTime)
128 AudioSystem.TerminateSound(moveData.m_AudioHandle);
129 m_aMoveData.Remove(i);
133 moveData.m_vPosition += moveData.m_vVelocity * timeSlice;
136 Math3D.MatrixIdentity4(mat);
137 mat[3] = moveData.m_vPosition;
139 AudioSystem.SetSoundTransformation(moveData.m_AudioHandle, mat);
146 foreach(SCR_MoveData moveData : m_aMoveData)
148 AudioSystem.TerminateSoundFadeOut(moveData.m_AudioHandle,
false, 0);
153 override void EOnPostFrame(
IEntity owner,
float timeSlice)
155 PlayMoveSound(timeSlice);
156 UpdateFlySoundPosition(timeSlice);
160 void SCR_MovingSoundSourceEntity(IEntitySource src,
IEntity parent)
167 void ~SCR_MovingSoundSourceEntity()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.