Beispiel #1
0
 public void SpawnCorrectly(FinishLineReached sender = null)
 {
     if (this != null)
     {
         do
         {
             FindNewPosition();
         } while (Vector2.Distance(transform.position, finishLine.transform.position) <= distanceFromStartLine ||
                  IsNear());
     }
 }
Beispiel #2
0
    private void RemoveGem(FinishLineReached sender)
    {
        if (this != null)
        {
            if (SpawnObstacles.gems.Contains(this))
            {
                SpawnObstacles.gems.Remove(this);
            }

            ObjectPooler.instance.DestroyFromPool(gemType.ToString(), gameObject);
        }
    }
Beispiel #3
0
    private void ChangeColor(FinishLineReached sender)
    {
        var _randomColorindex = Random.Range(1, colorList.Count + 1);

        while (_randomColorindex == currentRanomIndex)
        {
            _randomColorindex = Random.Range(1, colorList.Count + 1);
        }

        currentRanomIndex = _randomColorindex;

        cam.DOColor(colorDicitonary[_randomColorindex], transitionTime);
    }
    private void RotateBackwards(FinishLineReached sender)
    {
        rotateLaps += 1;
        Debug.Log(rotateLaps);

        if (rotateLaps == 3)
        {
            rotateScript.enabled = true;
            rotateScript.SetRotationSpeed(Random.Range(-7, 5));
        }
        else if (rotateLaps > 3)
        {
            rotateScript.enabled = false;
            rotateLaps           = 0;
        }
    }
Beispiel #5
0
 private void SpawnRightAmountOfObstacles(FinishLineReached sender = null)
 {
     if (levelData.GetLevelIndex() <= 4)
     {
         amountOfObstacles = Random.Range(3, 5);
         SpawnObstacle(amountOfObstacles);
     }
     else if (levelData.GetLevelIndex() <= 7 && levelData.GetLevelIndex() > 4)
     {
         amountOfObstacles = Random.Range(5, 7);
         SpawnObstacle(amountOfObstacles);
     }
     else if (levelData.GetLevelIndex() <= 10 && levelData.GetLevelIndex() > 7)
     {
         amountOfObstacles = Random.Range(7, 9);
         SpawnObstacle(amountOfObstacles);
     }
 }
Beispiel #6
0
 private void ResetPassage(FinishLineReached sender)
 {
     passed = false;
 }
Beispiel #7
0
 public void IncreaseLevelIndex(FinishLineReached sender)
 {
     levelIndex += 1;
 }
Beispiel #8
0
 private void FinishLineEffects(FinishLineReached sender)
 {
     transform.DOPunchRotation(new Vector3(5, 5f, 5f), 1f, 8, 1);
 }
Beispiel #9
0
 private void EnableRotateScript(FinishLineReached sender)
 {
     rotateScript.enabled = true;
     rotateScript.SetRotationSpeed(player.GetComponent <RotateScript>().GetRotationSpeed());
 }
Beispiel #10
0
 private void IncreaseScale(FinishLineReached sender = null)
 {
     transform.localScale = Vector3.zero;
     transform.DOScale(initLocalScale, scaleTime);
 }
 private void IncreaseSpeed(FinishLineReached sender)
 {
     rotateScript.IncreaseRotationSpeed(Speedincrement);
 }