@@ -27,6 +27,7 @@ namespace Ichni
|
||||
public RTPC LowPassFilter;
|
||||
|
||||
private uint _playingId;
|
||||
private AkSegmentInfo _segmentInfo;
|
||||
public float songTimeSegment = 0;
|
||||
public float pauseTimeSegment;
|
||||
private float duration;
|
||||
@@ -42,6 +43,12 @@ namespace Ichni
|
||||
isStarting = false;
|
||||
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
_segmentInfo?.Dispose();
|
||||
_segmentInfo = null;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
@@ -195,10 +202,10 @@ namespace Ichni
|
||||
|
||||
int PlaySegment()
|
||||
{
|
||||
AkSegmentInfo segmentInfo = new AkSegmentInfo();
|
||||
AkUnitySoundEngine.GetPlayingSegmentInfo(_playingId, segmentInfo,true);
|
||||
_segmentInfo ??= new AkSegmentInfo();
|
||||
AkUnitySoundEngine.GetPlayingSegmentInfo(_playingId, _segmentInfo,true);
|
||||
|
||||
return segmentInfo.iCurrentPosition;
|
||||
return _segmentInfo.iCurrentPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user