void StopAndDisposePlayer()
{
player.Stop();
ResetMaterialOfTargetObject()
var status = player.status;
while (status !=
CriWare.CriMana.Player.Status.Stop)
{
yield return null;
UpdatePlayer();
status = player.status;
}
player.Dispose();
player = null;
if (gcHandle.IsAllocated())
{
gcHandle.Free();
}
}
void ResetMaterialOfTargetObject()
{
if (originalMaterial != null)
{
target.material = originalMaterial;
originalMaterial = null;
}
}