public Tween GetMovingTween(SpawnMovingParameters spawnMovingParameters, bool useTimescale = true, bool withoutId = false, bool hasOnComplete = true) { _startPosition = gameObject.transform.position; Tween result = gameObject.transform.DOMoveX(-_startPosition.x, spawnMovingParameters.flyTime); if (hasOnComplete) { result.OnComplete(RecycleGameObject); } if (!withoutId) { result.SetId(HELLSPAWN_DOTWEEN_ID); } if (useTimescale) { result.timeScale = spawnMovingParameters.hellSpawnSpeed; } result.ForceInit(); return(result); }
public void StartMoving(SpawnMovingParameters spawnMovingParameters) { GetMovingTween(spawnMovingParameters); }