摘要:
可指定物体的旋转时间速度停下角度,可以参考来实现转盘抽奖或图片翻转打开等效果。 1 using UnityEngine; 2 using System.Collections; 3 4 public class Rotate : MonoBehaviour 5 { 6 public float ta 阅读全文
摘要:
1 // CameraMovement.cs 2 using UnityEngine; 3 using System.Collections; 4 5 public class CameraMovement : MonoBehaviour 6 { 7 public float smooth = 1. 阅读全文
摘要:
当变量重命名后,已序列化保存的值会丢失,如果希望继续保留其数值,可使用FormerlySerializedAs,如下代码所示: [UnityEngine.Serialization.FormerlySerializedAs("hp")] public int newHp = 20; Unity有个隐 阅读全文
摘要:
#region 和#endregion 关键字可以对代码分为几个片段进行说明注释,且可以展开和折叠该段代码区域。 基本类型的别名及取值范围:以上数字后面得加字母的,如float值后面必须加上F,不然会被编译器当作double处理。 4.2f == 4.2d 结果为false const:编译时确定的 阅读全文