标签:
学习笔记,如有错误请指正。?号处也请各位指点下,谢谢。
1创建cube
2创建脚本RotateSelf.cs,并赋值给cube‘
using UnityEngine; using System.Collections; public class RotateSelf : MonoBehaviour { public float speed = 180; // Use this for initialization void Start () { } // Update is called once per frame void Update () { transform.Rotate(Vector3.up*speed *Time.deltaTime); } public void OnValueChange(float value){ speed = value; } }
3创建ui,创建slider,物体赋值给slider,选择脚本onValueChange,设置MinValue和MaxValue
标签:
原文地址:http://www.cnblogs.com/kubll/p/5064187.html