Unity3d Editor使用
摘要:1:生成类A,用来保存相关数据public class AudioSource : MonoBehaviour{ public AudioClip m_AudioClip; void Awake() { } // Use this for initialization void Start () { }}2:生成类B,继承Editorusing UnityEditor;[CustomEditor(typeof(AudioSource))]public class InspectorAudioSource : Editor { public override void OnInspector..
阅读全文
Unity3D 代码保存prefab
摘要:Object tempPrefab = EditorUtility.CreateEmptyPrefab("Assets/res/audio/AudioSourcePrefab/" + gameObject.name + ".prefab");tempPrefab = EditorUtility.ReplacePrefab(gameObject, tempPrefab);
阅读全文
Unity3d TweenRotation 使用
摘要:/* * parentQuate:需要变换的对像 * angleX,angleY,angleZ: 旋转哪个方向 * angle:需要旋转的角度 0~360 */ static public Quaternion ChangeRotation(GameObject parnetQuate, float angleX, float angleY, float angleZ, float angle,bool IsAnimation,float duration) { Quaternion ans = Quaternion.identity; if( parnetQuat...
阅读全文