Sunday, 13 December 2015

Intensity Bar.


Intensity Bar , Script testing.

Script used C#

using UnityEngine;
using System.Collections;

public class Hslider : MonoBehaviour {
public Light mylight;
private float myintensity = 1.0f;
private float Swidth = Screen.width;
private float Sheight = Screen.height;
void Start()
{
}
void Update()
{
mylight.intensity = myintensity;
}
void OnGUI () 
{
myintensity = GUI.HorizontalSlider (new Rect (Swidth/2f-150f, Sheight/1.1f, 300, 30), myintensity, 0.0f, 10.0f);
}
}

No comments:

Post a Comment