上次 我们告诉编辑器制作,如何将图像加载到现场,如今 我们要告诉下。怎么样 制造UIButton以及UIimage交换。

阿土。

进入专题。

首先,我们要明白 unity机制。button属性等。

首先 我们先说下 unity的机制:

unity中检測点击事件,使用NGUI的可能知道,NGUI使用的就是SendMessage的方式来进行事件的传递。

没错,这也是 unity最为简便的方式。

(要注意一个问题哦,这个方式 假设 你要使用 大于 万次循环的话 会有延迟的哦,一般也不会同一时候发送万条事件的)。

我们知道了 事件的传送的方式,那么我们就開始制作这个规则。首先 要使用SendMessage的话我们要拿到gameobject的对象才干使用。

所以我们要想办法拿到点击的那个物体。怎么坐那,原理事实上非常easy,就是射线。

我们都知道,unity的射线是用来探測使用的 正好。我们全部能够看到的物体都是存在camera以下,那么我们就能够使用,从camera上发射射线,来达到检測物体的作用,物体要有碰撞体哦。

先贴部分代码等这个章节完了我会贴完整的代码

Ray cameraRay;
RaycastHit hit;
Vector3 touchPos,pressOffSet;
public static GameObject touchObj = null;
public static VKCamera shareVkCamera;

void Update () {
#if UNITY_EDITOR
if(Input.GetMouseButtonDown(0)){
onPressDown(Input.mousePosition);
}else if(Input.GetMouseButtonUp(0)){
onPressUp(Input.mousePosition);
}else if(Input.GetMouseButton(0)){
onDrag(Input.mousePosition);
}
#endif #if UNITY_IPHONE || UNITY_ANDROID
Touch touch;
if(Input.touchCount==1){
touch = Input.GetTouch (0);
switch(touch.phase){
case TouchPhase.Began:
onPressDown(touch.position);
break;
case TouchPhase.Moved:
onPressUp(touch.position);
break;
case TouchPhase.Ended:
case TouchPhase.Canceled:
onDrag(touch.position);
break;
}
}
#else
if(Input.GetMouseButtonDown(0)){
onPressDown(Input.mousePosition);
}else if(Input.GetMouseButtonUp(0)){
onPressUp(Input.mousePosition);
}else if(Input.GetMouseButton(0)){
onDrag(Input.mousePosition);
} #endif
}
public void onPressDown(Vector2 vec){
touchPos = vec;
for(int i=0 ; i<Camera.allCameras.Length;i++){
cameraRay = Camera.allCameras[i].ScreenPointToRay(touchPos);
if(Physics.Raycast(cameraRay,out hit,9999,Camera.allCameras[i].cullingMask) && touchObj == null){
touchObj = hit.transform.gameObject;
if(touchObj!=null && touchObj.GetComponent<VKButton>()){
touchPos = Camera.allCameras[i].ScreenToWorldPoint(touchPos);
pressOffSet =touchObj.transform.position-touchPos;
VKButton button = touchObj.GetComponent<VKButton>();
if(!iSNull(button.pressEventName) && button.eventObj!=null)
button.eventObj.SendMessage(button.pressEventName,button);
if(button.pressButtonTex!=null){
button.renderer.sharedMaterial.mainTexture = button.pressButtonTex;
}
if(button.isDrag && !iSNull(button.dragStartEventName)){
button.eventObj.SendMessage(button.dragStartEventName,vec);
}
if(button.isAni){
button.SendMessage("onPressAni");
}
}
}
}
}

	public void onPressUp(Vector2 vec){
if(touchObj!=null){
VKButton button = touchObj.GetComponent<VKButton>();
if(button!=null){
if(button.buttonTex!=null){
touchObj.renderer.sharedMaterial.mainTexture = touchObj.GetComponent<VKButton>().buttonTex;
}
if(!iSNull(button.clickEventName) && button.eventObj!=null){ button.eventObj.SendMessage(button.clickEventName,button);
} if(button.isDrag && !iSNull(button.dragEndEventName)){
button.SendMessage(button.dragEndEventName,vec);
}
if(button.isAni){
button.SendMessage("onClickAni");
}
}
touchObj = null;
}
}
	public void onDrag(Vector2 vec){
if(touchObj!=null){
VKButton button = touchObj.GetComponent<VKButton>();
if(button!=null && button.isDrag){
for(int i= 0;i<Camera.allCameras.Length;i++){
Vector2 worldVec = Camera.allCameras[i].ScreenToWorldPoint(vec);
touchObj.transform.position = new Vector3(worldVec.x+pressOffSet.x,worldVec.y+pressOffSet.y,touchObj.transform.position.z);
if(!iSNull(button.dragEventName))
button.eventObj.SendMessage(button.dragEventName,worldVec);
} }
} }
	bool iSNull(string eventName){
bool buttonIsNull = false;
if(eventName== null || eventName.Equals("null")){
buttonIsNull =true;
}
return buttonIsNull;
}

这些是camera的部分,另一点这个 我们没有贴我的适配方案 摄像机的适配方案。这里统配是1420*800的设计方案。由于这里我预计还要改下,发现这个摄像机适配方案,超出了unity的物理引擎的范围。不建议。只是能够參考。

public void initVKCamere(){
gameObject.name = "VKCamere";
this.camera.orthographic = true;
this.camera.backgroundColor = Color.black;
this.camera.nearClipPlane = 0;
this.camera.farClipPlane = 9999;
this.camera.orthographic =true;
this.camera.orthographicSize = getCameraSize ();
this.transform.position = new Vector3(0,0,-1000);
this.transform.rotation = Quaternion.Euler(Vector3.zero);
this.transform.localScale = Vector3.one;
Application.targetFrameRate=60;
if(GetComponent<AudioListener>()){
//DestroyImmediate(GetComponent<AudioListener>());
} }
int getCameraSize(){
int size = 384;
bool isLandscape=(Camera.main.pixelWidth>Camera.main.pixelHeight);
float rad = Camera.main.pixelWidth/Camera.main.pixelHeight;
bool isIPad= (Mathf.Abs(rad-1.3333f)<0.001f) || (Mathf.Abs(rad-0.75f)<0.001f);
if(isIPad){
if(isLandscape){
size=400;
}else{
size=533;
}
}else{
if(isLandscape){
size=400;
}else{
//iPhone 5
if(Camera.main.pixelHeight/Camera.main.pixelWidth>1.6){
size=710;
}else{
size=600;
}
}
}
return size;
}

camera的编辑器类

using UnityEditor;
using UnityEngine;
using System.Collections; [CustomEditor(typeof(VKCamera))]
public class VKCameraEditor : Editor { public override void OnInspectorGUI (){ base.OnInspectorGUI();
VKCamera vkCamere = (VKCamera)target; if(GUILayout.Button("ReSetCamera")){
vkCamere.initVKCamere();
}
EditorUtility.SetDirty(vkCamere);
EditorUtility.UnloadUnusedAssets();
} }

好以下我们来讲述下,button的一些东西,事实上就非常easy了。

仅仅是在编辑器方面可能会有些麻烦。

说白了 就是button就来处理 摄像机发来的东西。

尽管非常easy的一句话。但我们写得东西还是有非常多的。

依旧,button还是继承前面的view

using UnityEngine;
using System.Collections;
using Holoville.HOTween; //[RequireComponent(typeof(BoxCollider))]
public class VKButton : VKView { [HideInInspector] public Material buttonDefultMat;
[HideInInspector] public Mesh buttonDefultMesh;
[HideInInspector] public Texture buttonTex,pressButtonTex;
[HideInInspector] public string pressEventName = null;
[HideInInspector] public string clickEventName = null;
[HideInInspector] public string dragStartEventName = null;
[HideInInspector] public string dragEventName = null;
[HideInInspector] public string dragEndEventName = null;
[HideInInspector] public GameObject eventObj = null;
[HideInInspector] public string eventScript = null;
[HideInInspector] public bool isDrag = false;
[HideInInspector] public float scale = 1;
[HideInInspector] public string info= null;
[HideInInspector] public string[] animatorType = new string[]{"null","bigger","smaller","moveLeft","moveRight"};
[HideInInspector] public int currentAnimator = 0;
[HideInInspector] public bool isAni = false;
void Start () {
buttonDefultMat = new Material(Shader.Find("VK/VKButtonShader"));
gameObject.GetComponent<MeshRenderer> ().material = buttonDefultMat;
buttonDefultMesh = new Mesh ();
gameObject.GetComponent<MeshFilter> ().mesh = buttonDefultMesh;
if(GetComponent<BoxCollider>()== null)
gameObject.AddComponent<BoxCollider>();
updateButton(); } public float setScale{
set{
scale = value;
}get{
return scale;
}
} public void updateButton(){ if(buttonTex!=null){
if(buttonDefultMat!=null)
buttonDefultMat.mainTexture = buttonTex;
if(buttonDefultMesh!=null)
buttonDefultMesh.vertices = InitBase.initVertice(buttonTex.width *scale,buttonTex.height*scale,ancPointx,ancPointy);
if(this!=null&&gameObject.GetComponent<BoxCollider>()!=null){
gameObject.GetComponent<BoxCollider>().size = new Vector3(buttonTex.width*scale,buttonTex.height*scale,0);
} }else{
if(buttonDefultMat!=null)
buttonDefultMat.mainTexture = null;
if(buttonDefultMesh!=null)
buttonDefultMesh.vertices = InitBase.initVertice(width*scale,height*scale,ancPointx,ancPointy);
gameObject.GetComponent<BoxCollider>().size = new Vector3(width,height,0);
}
if(buttonDefultMesh!= null){
buttonDefultMesh.triangles = InitBase.initTri ();
buttonDefultMesh.normals = InitBase.initNormal();
buttonDefultMesh.uv = InitBase.initUV();
}
} Vector3 pressScale= Vector3.zero;
Vector3 pressPos = Vector3.zero;
Tweener tw = null;
void onPressAni(){
if(tw!=null && !tw.isComplete){
return;
}
pressScale = transform.localScale;
pressPos = transform.position;
switch(currentAnimator){
case 1:
tw = VKAnimator.scaleBy(gameObject,0.3f,Vector3.one*0.2f,VkAniDuration.AnimationCurve,null);
break;
case 2:
tw = VKAnimator.scaleBy(gameObject,0.3f,Vector3.one*-0.2f,VkAniDuration.AnimationCurve,null);
break;
case 3:
tw = VKAnimator.moveBy(gameObject,0.3f,new Vector3(-10f,0,0),false,VkAniDuration.AnimationCurve,null);
break;
case 4:
tw = VKAnimator.moveBy(gameObject,0.3f,new Vector3(10f,0,0),false,VkAniDuration.AnimationCurve,null);
break;
}
} void onClickAni(){
if(currentAnimator == 1 || currentAnimator==2){
VKAnimator.scaleTo(gameObject,0.3f,pressScale,VkAniDuration.AnimationCurve,null);
} else if(currentAnimator == 3 || currentAnimator==4){
VKAnimator.moveTo(gameObject,0.3f,pressPos,false,VkAniDuration.AnimationCurve,null);
}
} public void switchImageView(){
VKImageView imgView = gameObject.AddComponent<VKImageView> ();
imgView.imgViewTex = buttonTex;
imgView.highLightedTex = pressButtonTex;
imgView.ancPointx = ancPointx;
imgView.ancPointy = ancPointy;
imgView.scale = scale;
imgView.updateImageView ();
if(GetComponent<BoxCollider>()){
DestroyImmediate(GetComponent<BoxCollider>());
} DestroyImmediate (GetComponent<VKButton>());
} }

这里有个 动画效果 我是自己使用的hotween整合的一些东西,假设你想用自己的能够自己去做。hotween插件 我就不用发布了,能够去官网进行下载,各大论坛也有下载资源。

using UnityEngine;
using System.Collections;
using Holoville.HOTween; public enum VkAniDuration{
AnimationCurve = EaseType.AnimationCurve,
EaseInBack=EaseType.EaseInBack,
EaseInBounce=EaseType.EaseInBounce,
EaseInCirc=EaseType.EaseInCirc,
EaseInCubic=EaseType.EaseInCubic,
EaseInElastic=EaseType.EaseInElastic,
EaseInExpo=EaseType.EaseInExpo,
EaseInOutBack=EaseType.EaseInOutBack,
EaseInOutBounce=EaseType.EaseInOutBounce,
EaseInOutCirc=EaseType.EaseInOutCirc,
EaseInOutCubic=EaseType.EaseInOutCubic,
EaseInOutElastic=EaseType.EaseInOutElastic,
EaseInOutExpo=EaseType.EaseInOutExpo,
EaseInOutQuad=EaseType.EaseInOutQuad,
EaseInOutQuart=EaseType.EaseInOutQuart,
EaseInOutQuint=EaseType.EaseInOutQuint,
EaseInOutSine=EaseType.EaseInOutSine,
EaseInQuad=EaseType.EaseInQuad,
EaseInQuart=EaseType.EaseInQuart,
EaseInQuint=EaseType.EaseInQuint,
EaseInSine=EaseType.EaseInSine,
EaseOutBack=EaseType.EaseOutBack,
EaseOutBounce=EaseType.EaseOutBounce,
EaseOutCirc=EaseType.EaseOutCirc,
EaseOutCubic=EaseType.EaseOutCubic,
EaseOutElastic=EaseType.EaseOutElastic,
EaseOutExpo=EaseType.EaseOutExpo,
EaseOutQuad=EaseType.EaseOutQuad,
EaseOutQuart=EaseType.EaseOutQuart,
EaseOutQuint=EaseType.EaseOutQuint,
EaseOutSine=EaseType.EaseOutSine,
Linear=EaseType.Linear
}; public class VKAnimator { // public static Tweener moveTo(GameObject obj,float time,Vector3 target,bool isLocal,VkAniDuration vkDurType = VkAniDuration.AnimationCurve){
// Tweener tw = null;
// if(isLocal)
// tw = startVkAnimote(obj,time,"localPosition",target,vkDurType,null);
//
// else
// tw = startVkAnimote(obj,time,"position",target,vkDurType,null);
// return tw;
// } public static Tweener moveTo(GameObject obj,float time,Vector3 target,bool isLocal,VkAniDuration vkDurType = VkAniDuration.AnimationCurve,VKAniComplete completeObj = null){
Tweener tw = null;
if(isLocal)
tw =startVkAnimote(obj,time,"localPosition",target,vkDurType,completeObj); else
tw = startVkAnimote(obj,time,"position",target,vkDurType,completeObj);
return tw;
} public static Tweener moveBy(GameObject obj,float time,Vector3 offset,bool isLocal,VkAniDuration vkDurType = VkAniDuration.AnimationCurve,VKAniComplete completeObj = null){
Tweener tw = null;
if(isLocal){
Vector3 tLocalPos = obj.transform.localPosition + offset;
tw = startVkAnimote(obj,time,"localPosition",tLocalPos,vkDurType,completeObj);
}else{
Vector3 tPos = obj.transform.position + offset;
tw = startVkAnimote(obj,time,"position",tPos,vkDurType,completeObj);
}
return tw;
} public static Tweener scaleTo(GameObject obj,float time,Vector3 scale,VkAniDuration vkDurType = VkAniDuration.AnimationCurve,VKAniComplete completeObj = null){
Tweener tw = null;
tw = startVkAnimote(obj,time,"localScale",scale,vkDurType,completeObj);
return tw;
} public static Tweener scaleBy(GameObject obj,float time,Vector3 offsetScale,VkAniDuration vkDurType = VkAniDuration.AnimationCurve,VKAniComplete completeObj = null){
Tweener tw = null;
Vector3 targetScale = obj.transform.localScale+offsetScale;
tw = startVkAnimote(obj,time,"localScale",targetScale,vkDurType,completeObj);
return tw; } public static Tweener routeTo(GameObject obj,float time,Vector3 routeEulerTarget,VkAniDuration vkDurType = VkAniDuration.AnimationCurve,VKAniComplete completeObj = null){
Tweener tw = null;
tw = startVkAnimote(obj,time,"localEulerAngles",routeEulerTarget,vkDurType,completeObj);
return tw;
} public static Tweener routeBy(GameObject obj,float time,Vector3 routeEulerOffset,VkAniDuration vkDurType = VkAniDuration.AnimationCurve,VKAniComplete completeObj = null){
Tweener tw = null;
Vector3 target = obj.transform.localEulerAngles+ routeEulerOffset;
tw = startVkAnimote(obj,time,"localEulerAngles",target,vkDurType,completeObj);
return tw;
} //localEulerAngles private static Tweener startVkAnimote(GameObject obj,float time,string key,object target,VkAniDuration vkDurType = VkAniDuration.AnimationCurve,VKAniComplete completeObj = null){
Tweener tw = null;
TweenParms twp = new TweenParms();
twp.Prop(key,target);
twp.Ease((EaseType)vkDurType);
if(completeObj!=null){
twp.OnComplete(completeObj.sendTargetObj,completeObj.methodName,completeObj.sendobj,SendMessageOptions.DontRequireReceiver);
}
tw = HOTween.To(obj.transform,time,twp);
return tw;
}
}
using UnityEngine;
using System.Collections; public class VKAniComplete{
public GameObject sendTargetObj = null;
public string methodName = null;
public object sendobj = null; public VKAniComplete(GameObject sendTargetObj,string methodName,object sendobj){
this.sendTargetObj = sendTargetObj;
this.methodName = methodName;
this.sendobj = sendobj;
}
}

以下就是button的编辑器方面了。

ok,这里可能有点麻烦。

只是还是能够解决的。

首先我们要获取脚本里面的方法怎么获取那。依据c#的MSDN的描写叙述我们能够看到。就是下面方法。这就是 为什么 NGUI 仅仅能找到public属性的方法。

using UnityEngine;
using System.Collections;
using System.Reflection; public class GetPublic : MonoBehaviour { static public MethodInfo[] GetObjectMethods(string selectedObjClass){
if(selectedObjClass==null)return null;
MethodInfo[] methodInfos=null;
if(System.Type.GetType(selectedObjClass)==null){
return methodInfos;
}
methodInfos = System.Type.GetType(selectedObjClass).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
return methodInfos;
} }

这里就是button编辑器的一些属性的传递,和界面的改动哈。

using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Reflection; [CustomEditor(typeof(VKButton))]
public class VKButtonEditor : Editor { public override void OnInspectorGUI ()
{ int pressEventNum= 0;
int selectScriptNum = 0;
int clickEventNum = 0;
int dragStartEveNum = 0;
int dragEveNum = 0;
int dragEndEveNum = 0; VKButton button = (VKButton)target;
button.buttonTex = EditorGUILayout.ObjectField ("Texture",button.buttonTex,typeof(Texture),true)as Texture;
button.pressButtonTex = EditorGUILayout.ObjectField ("PressButtonTex",button.pressButtonTex,typeof(Texture),true)as Texture;
button.eventObj = EditorGUILayout.ObjectField("eventObj",button.eventObj,typeof(GameObject),true) as GameObject; button.info = EditorGUILayout.TextField("info",button.info); button.ancPointx = EditorGUILayout.Slider("AnchorX",button.ancPointx,0.0f,1.0f);
button.ancPointy = EditorGUILayout.Slider("AnchorY",button.ancPointy,0.0f,1.0f);
if(button.buttonTex == null){
button.width=EditorGUILayout.IntField("Width",button.width);
button.height=EditorGUILayout.IntField("Height",button.height);
}
GUILayout.BeginHorizontal();
if(GUILayout.Button("2X")){
button.setScale = 0.5f;
}
if(GUILayout.Button("1X")){
button.setScale = 1f;
}
if(GUILayout.Button("1.5X")){
button.setScale = 0.75f;
}
GUILayout.EndHorizontal(); GUILayout.BeginHorizontal();
if(GUILayout.Button("ChangeName")){
if(button.buttonTex!=null){
button.name = button.buttonTex.name;
}
}
if(GUILayout.Button("Switch ImageView")){
button.switchImageView();
}
GUILayout.EndHorizontal(); if(button.eventObj!=null){
MonoBehaviour[] monoScriptArry =new MonoBehaviour[button.eventObj.GetComponents<MonoBehaviour>().Length+1];// button.eventObj.GetComponents<MonoBehaviour>();
for(int i=0;i<monoScriptArry.Length;i++){
if(i<monoScriptArry.Length-1)
monoScriptArry [i] = button.eventObj.GetComponents<MonoBehaviour>()[i];
if(i == monoScriptArry.Length-1){
monoScriptArry [i] = null;
}
} if(monoScriptArry !=null&& monoScriptArry.Length>0){
string [] scriptName = new string[monoScriptArry.Length]; for(int i=0;i<scriptName.Length;i++){
if(monoScriptArry[i]!=null){
scriptName[i] = monoScriptArry[i].GetType().ToString();
if(scriptName[i].Equals("VKCamera")){
scriptName[i] = "null";
}
}else{
scriptName[i] = "null";
} if(scriptName[i].Equals(button.eventScript)){
selectScriptNum = i;
}
} selectScriptNum = EditorGUILayout.Popup("EventScript",selectScriptNum,scriptName);
button.eventScript = scriptName[selectScriptNum];
MethodInfo[] publicMethodArry;
if(button.eventScript == null || button.eventScript.Equals("null")){
publicMethodArry = new MethodInfo[1];
}else{
publicMethodArry = new MethodInfo[GetPublic.GetObjectMethods(button.eventScript).Length+1];
} for(int i = 0;i<publicMethodArry.Length;i++){
if(i<publicMethodArry.Length-1){
publicMethodArry[i] =GetPublic.GetObjectMethods(button.eventScript)[i];
}else{
publicMethodArry[i] = null;
}
} if(publicMethodArry!=null && publicMethodArry.Length>0){
string[] methodArry = new string[publicMethodArry.Length];
for(int i=0;i<methodArry.Length;i++){
if(publicMethodArry[i]!=null){
methodArry[i] = publicMethodArry[i].Name;
}else{
methodArry[i] ="null";
} if(button.pressEventName !=null && button.pressEventName.Equals(methodArry[i])){
pressEventNum = i;
}
if(button.clickEventName != null && button.clickEventName.Equals(methodArry[i])){
clickEventNum = i;
} if(button.isDrag){
if(button.dragStartEventName != null && button.dragStartEventName.Equals(methodArry[i])){
dragStartEveNum = i;
}
if(button.dragEventName != null && button.dragEventName.Equals(methodArry[i])){
dragEveNum = i;
}
if(button.dragEndEventName != null && button.dragEndEventName.Equals(methodArry[i])){
dragEndEveNum = i;
}
}
} pressEventNum = EditorGUILayout.Popup("PressEvent",pressEventNum,methodArry);
clickEventNum = EditorGUILayout.Popup("ClickEvent",clickEventNum,methodArry);
button.pressEventName = methodArry[pressEventNum];
button.clickEventName = methodArry[clickEventNum];
button.isAni = EditorGUILayout.Toggle ("ISAimator",button.isAni);
if(button.isAni){
button.currentAnimator = EditorGUILayout.Popup("ButtonAnimator",button.currentAnimator,button.animatorType);
} button.isDrag = EditorGUILayout.Toggle ("ISDrag",button.isDrag); if(button.isDrag){
// EditorGUILayout.LabelField("---------------------------------------------");
dragStartEveNum = EditorGUILayout.Popup("DragStartEvent",dragStartEveNum,methodArry);
dragEveNum = EditorGUILayout.Popup("DragEvent",dragEveNum,methodArry);
dragEndEveNum = EditorGUILayout.Popup("DragEndEvent",dragEndEveNum,methodArry); button.dragStartEventName = methodArry[dragStartEveNum];
button.dragEventName = methodArry[dragEveNum];
button.dragEndEventName =methodArry[dragEndEveNum];
} }else{
pressEventNum = EditorGUILayout.Popup("PressEvent",pressEventNum,new string[]{"null"});
clickEventNum = EditorGUILayout.Popup("ClickEvent",clickEventNum,new string[]{"null"});
}
} }else{
button.isAni =false;
button.isDrag =false;
} button.updateButton ();
if(button!=null){
EditorUtility.SetDirty(button);
}
EditorUtility.UnloadUnusedAssets();
}
}

我在这里扩展一些功能。像移动啊。什么。

。其实还可以添加一些功能 。这里只是学习。

有兴趣的东西可以添加你自己。

unity 编辑器和插件生产(四.2)的更多相关文章

  1. Curved UI - VR Ready Solution To Bend Warp Your Canvas 1.7,1.8,2.2,2.3 四种版本压缩包(Unity UGUI曲面插件),可以兼容VRTK

    Curved UI - VR Ready Solution To Bend Warp Your Canvas 1.7,1.8,2.2,2.3 四种版本压缩包(Unity UGUI曲面插件) 可以兼容V ...

  2. 转载unity编辑器xml数据库插件

    unity编辑器xml数据库插件 注:9月9日更新,其中MyXML.cs中有一句代码写错,查找功能失误,文中已经修改! 注:9月1日更新说明:xml存储结构,因为在用xml之前不知道正规的xml数据结 ...

  3. 关于Unity中DOTween插件的使用(专题一)

    DOTween flash里面的一个概念叫补间动画,DOTween就是干这个事情的. 补间动画:在1秒钟之内从A点移动到B点,在这个之间会把动画补间补好. 当我们安装好DOTween后,它就会提供很多 ...

  4. unity assetStore 常用插件

    常用插件 20180723============= 教程类 =============<Mecanim Example Scenes > 官方示例场景<Surivial Shoot ...

  5. Unity的NGUI插件篇——入场效果

    Unity的NGUI插件篇--入场效果 入场效果 入场效果须要借助于NGUI提供的TweenPosition类来完毕.为了说明此类的用法.本节将使会解说两个演示样例.本文选自  大学霸 <NGU ...

  6. 【Unity编辑器】UnityEditor多重弹出窗体与编辑器窗口层级管理

    一.简介 最近马三为公司开发了一款触发器编辑器,对于这个编辑器策划所要求的质量很高,是模仿暴雪的那个触发器编辑器来做的,而且之后这款编辑器要作为公司内部的一个通用工具链使用.其实,在这款触发器编辑器之 ...

  7. 【Unity】2.1 初识Unity编辑器

    分类:Unity.C#.VS2015 创建日期:2016-03-26 一.简介 本节要点:了解Unity编辑器的菜单和视图界面,以及最基本的操作,这是入门的最基础部分,必须掌握. 二.启动界面 双击桌 ...

  8. Unity编辑器扩展chapter1

    Unity编辑器扩展chapter1 unity通过提供EditorScript API 的方式为我们提供了方便强大的编辑器扩展途径.学好这一部分可以使我们学会编写一些工具来提高效率,甚至可以自制一些 ...

  9. Unity 编辑器扩展

    自定义检视面板的使用: 先是定义一个脚本文件,我们来修饰它的检视面板: [HelpURL("http://www.baidu.com")] public class Atr : M ...

随机推荐

  1. Java调用Lua(转)

    Java 调用 Lua app发版成本高,覆盖速度慢,覆盖率页低.一些策略上的东西如果能够从服务端控制会方便一些.所以考虑使用Lua这种嵌入式语言作为策略实现,Java则是宿主语言. 总体上看是一个模 ...

  2. 在struts2中訪问servletAPI

    在struts2中訪问servletAPI,通俗点也就是使用servlet中的两个对象request对象和response对象. 前几天看到一个CRM项目的源代码,里面使用request对象和resp ...

  3. ADO.NET连接方式

    使用Command.DataReader和DataSet两种方法实现数据绑定 方法1:使用Command和DataReader SqlConnection con = new SqlConnectio ...

  4. 线性表实现简单vector

    实现一个简单的vector Vector基于数组实现,可以复制并且其占用的内存可以自动回收(通过析构函数),可以调整Vector的大小,以及容量(容量的改变是通过为基本数组分配一个新的内存块,然后复制 ...

  5. Android 混淆proguard的实现(图文)

    1.  在Eclipse中的project编译执行后,在文件夹bin以下有生成一些文件,当中classes.dex是未经过混淆生成的.而我们要混淆的话,就要又一次生成一个混淆过的classes.dex ...

  6. 解析DBR操作系统引导记录数据

    理解文件系统.你必须要熟悉DBR,下面我们就来看看文件系统解析DBR数据. Dos Boot Record(DBR)操作系统引导记录是由操作系统的格式化程序建立的.在文件系统驱动操作不论什么一个磁盘卷 ...

  7. JAVA基础编程50题(10-12题)具体解释

    一.描写叙述 1.一球从m米高度自由落下.每次落地后反跳回原高度的一半:再落下,求它在 第n次落地时.共经过多少米?第10次反弹多高? 2.有1.2.3.4个数字.能组成多少个互不同样且无反复数字的三 ...

  8. c语言 int (*p)[5] 类型分析

    #include<stdio.h> int main() {     int i;     int  b[5]={1,3,5,7,9};     int  (*a)[5] = &b ...

  9. BZOJ 2007 NOI2010 海拔高度 最小减产计划

    标题效果:YT城市是一个精心规划的城市.这个城市是东西向和南北向干道成n×n地区性.简单.可以YT作为一个城市广场,每个区域也可被视为一个正方形.因此,.YT市中含有(n+1)×(n+1)交叉口和2n ...

  10. 获取activity的根视图

    Activity的根视图是什么? Activity所谓的根视图,就是Activity的最底层的View,也就是在Acitivty创建的时候setContentView的时候传入的View. 如何获取到 ...