- 博客(4)
- 收藏
- 关注
原创 关于物体圆周运动的相关总结
public Transform target; // Update is called once per frame片 void Update() { Vector3 relatives = target.position - transform.position; Quaternion rotation = Quaternion.LookRotation(relatives,Vector3.down); Debug.Log(ro
2021-09-28 14:22:59
303
原创 关于list的排序问题
首先定义一个List类列表是泛型类,可以存储任意类型,本文中,我们先创建BadGuy类,有两个公共字段 name和 power。public class BadGuy :{ public string name; public int power; public BadGuy(string newname, int newpower) //公共构造函数 { name = newname; power = newpower;
2021-09-16 17:46:40
136
转载 MonoBehaviour常用方法
目录1.Awake()2.Start()3. Update()4.FixedUpdate()5.LateUpdate()6.DontDestroyOnLoad()7.OnGUI()1.Awake()当脚本被加载后立即调用Awake方法,这个方法通常在Start()开始之前声明某些变量或者游戏的状态标记符。Awake在MonoBehaviour声明周期内只被调用一次。Awake在所有的对象实例化后被调用,所以脚本的一些成员,如果想在创建之后的代码中立即使用,则必须写在Awake()里面。2.Star
2021-09-16 15:23:51
444
原创 Unity 初级学习
1.通过键盘按键改变被挂载模型颜色using UnityEngine;using System.Collections;void Update{ if (Input.GetKeyDown.(Keycode.G)) { GetComponent<Renderer> ().material.color = Color.red; } }
2021-04-21 11:19:14
107
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人