摘要:1 //读取 2 FileStream rfs = new FileStream(@"x:\xxx\xxx.xxx", FileMode.Open, FileAccess.Read); 3 //写入 4 FileStream wfs = new FileStream(@"x:\xxx\xxx.xxx
阅读全文
05 2023 档案
摘要:1 private void OnMouseDown() 2 { 3 print("在xxx身上按下了鼠标"); 4 } 5 6 private void OnMouseUp() 7 { 8 print("在xxx身上按下的鼠标抬起了"); 9 } 10 11 private void OnMous
阅读全文
摘要:1 //仅发送消息给自己(以及身上的其他MonoBehaviour对象) 2 gameObject.SendMessage("xxx"); 3 SendMessage("xxxx","xxxx"); 4 SendMessage("xxxxx",SendMessageOptions.DontRequi
阅读全文
摘要:1 public class EventFunction : MonoBehaviour 2 { 3 public float attackValue=10000; 4 public float currentHP; 5 6 //对变量赋值的顺序(左边最先赋值,右边最后赋值,以此类推): 7 //变
阅读全文
摘要:混合动画 1 private Vector2 lookDir = new Vector2(0, -1); 2 private Vector2 move = new Vector2(0, 0); 3 void Update() 4 { 5 //移动 6 float horizontal = Input
阅读全文
摘要:2d射线检测 1 RaycastHit2D hit2D = Physics2D.Raycast(GetComponent<Rigidbody2D>().position + Vector2.up * 0.2f, lookDir, 1.5f, LayerMask.GetMask("xxx")); 2
阅读全文