void BackgroundAnimation()
 {
     if (enableAnimations)
     {
         if (Math.Abs(rockstar.GetPosition().x - spotlight.GetPosition().x) < 1)
         {
             background.speed = Mathf.Clamp(background.speed + Time.deltaTime, 0f, 1f);
         }
         else
         {
             background.speed = Mathf.Clamp(background.speed - Time.deltaTime, 0f, 1f);
         }
     }
 }
Beispiel #2
0
    public IEnumerator TestNoMove()
    {
        Vector2 currPos = testObj_spotlight.GetPosition();

        yield return(new WaitForEndOfFrame());

        Assert.AreEqual(currPos, testObj_spotlight.GetPosition());
    }