unity 有时候找路径太麻烦 写了一个自动生成脚本的工具 using System.Collections.Generic; using System.IO; using System.Text; using UnityEditor; using UnityEngine; public class Auto_BuildCode { private static string path_dic = Application.dataPath + "/Code"; private stat
using UnityEngine; public class NewBehaviourScript : MonoBehaviour { // Use this for initialization void Start () { gameObject.AddComponent<NewBehaviourScript>();//添加组件 Renderer render = gameObject.GetComponent<Renderer>();//查找组件 render.enable
//在unit菜单加入Component->b2Components->b2BodyComponent [AddComponentMenu("b2Components/b2BodyComponent")] public class b2BodyComponent : MonoBehaviour { }