Advertisement
AndrewRosyaev

FixSize.cs

May 14th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class FixSize : MonoBehaviour
  5. {
  6.     private float currentSize = 0.5f;
  7.     public Transform[] objects;
  8.     void Update ()
  9.     {
  10.         for(int i = 0; i<objects.Length; i++)
  11.         {
  12.             objects[i].localScale = new Vector3(currentSize,currentSize,currentSize);
  13.         }
  14.     }
  15.     void OnGUI()
  16.     {
  17.         currentSize = GUI.HorizontalSlider(new Rect(Screen.width-350, Screen.height-60, 300, 30), currentSize, 0.0F, 2.0F);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement