private void ReachDestination() { effectDestination.Spawn(GetPos(), Quaternion.identity); AudioManager.PlaySound(soundDestination); GameControl.LostLife(lifeLostOnDestination); if (path.loop) { wpIdx = 0; subWpIdx = 0; SpawnManager.ClearCleanWaveFlag(waveIdx); ResetPathOffset(); if (path.warpToStart) { thisT.position = path.GetWP(0)[0] + pathOffsetV; if (faceTravelingDir) { thisT.rotation = Quaternion.LookRotation(path.GetWP(1)[0] + pathOffsetV - GetPos()); } } } else { path.OnCreepExit(this); path = null; AnimPlayMove(0); float animDuration = AnimPlayDestination(); SpawnManager.CreepDestroyed(this, true); ObjectPoolManager.Unspawn(thisObj, animDuration); } //Destroy(thisObj); }