예제 #1
0
 override public void setInitialValues(SpaceObject spaceObject)
 {
     spaceObject.AdjustSize(scale);
     spaceObject.AdjustSpeed(minSpeed, maxSpeed);
     spaceObject.AdjustMass(scale);
     if (overrideSprite != null)
     {
         SpriteRenderer spriteRenderer = spaceObject.GetComponent <SpriteRenderer>();
         spriteRenderer.sprite = overrideSprite;
     }
 }
 virtual public void setInitialValues(SpaceObject spaceObject)
 {
     if (randomiseTransparency)
     {
         SpriteRenderer spriteRenderer = spaceObject.GetComponent <SpriteRenderer>();
         Color          newColor       = spriteRenderer.color;
         float          newAlpha       = Random.Range(.4f, 1f);
         newColor.a           = newColor.a * newAlpha;
         spriteRenderer.color = newColor;
     }
     if (randomiseScale)
     {
         float newScale = Random.Range(.5f, 1f);
         spaceObject.AdjustSize(newScale);
     }
     if (overrideSprite != null)
     {
         SpriteRenderer spriteRenderer = spaceObject.GetComponent <SpriteRenderer>();
         spriteRenderer.sprite = overrideSprite;
     }
 }