Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
 public void StartMoving(SpawnMovingParameters spawnMovingParameters)
 {
     GetMovingTween(spawnMovingParameters);
 }