位置: 编程技术 - 正文
推荐整理分享Drag and drop in unity,希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!
Hello guys, today I am going to show you how to make click on individual object and drag it to wherever you want in unity 3d in a very simple way. I hope that all you guys know basic of unity 3d. Let’s get started, first of all create plane from GameObject > Plane to use as background so we can our objects when we are dragging it and change its colour to whatever you want but make sure it is different then other objects. Ok lets create cube in the scene from GameObject > Cube so we can drag it around the scene. And if you want change the colour. Now create one C# script from project panel, create > C# script and open with monodevelop or whatever script editor you are using. Then type the following.
After that attach the script to the cube we created before and hit play.
wallaaa, now you can drag and move around your object wherever you want. If want to see that you can drag individually or not just create another cube and attach the script and hit play. And enjoy your drag and drop…….
来源:AarlangdiTutorials for Developers
Adding iAd in your App from Unity3d Inthischapter,let’stakealookinhowtoaddiAdinyourappfromUnity3d.Itisverysimpletodo.Let’stakealook.First,createanemptygameobjectinyoursceneandnameitwhatevermakesyoueasytoremember,IamgoingtonameitiAd[
unity->把由个元素组成的一维数组逆序存放再输出。 把由个元素组成的一维数组逆序存放再输出。usingUnityEngine;usingSystem.Collections;publicclasschena:MonoBehaviour{voidStart(){intt;intj=0;strings=;//int[]chen={1,2,3,4,5,6,7,8,9,
Unriy->C# 数组倒序存放 usingUnityEngine;usingSystem.Collections;publicclasschena:MonoBehaviour{voidStart(){intt;intj=0;strings=;int[]aa=newint[]{1,2,3,4,5,6,7,8,9,};for(inti=0;i;i){s=aa[i];}for(inti=9;iaa.Length/2;i--
友情链接: 武汉网站建设