《Android水管工游戏的简单脚本》由会员分享,可在线阅读,更多相关《Android水管工游戏的简单脚本(8页珍藏版)》请在金锄头文库上搜索。
1、Android 水管工游戏的简单脚本 Posted on 2013 年 07 月 04 日 by U3d / Unity3D 脚本/插件 /被围观 72 次 00 1using UnityEngine; 00 2using System.Collections; 00 300 4public class TestGoto : MonoBehaviour 00 5public GUISkin skin; 00 6float width; 00 7float height; 00 8public Texture up; 00 9public Texture down; 01 0public Tex
2、ture right; 01 1public Texture left; 01 2public Texture up_down; 01 3public Texture right_left; 01 4int images; 01 5Vector4 dires; 01 6int flag; 01 7int step; 01 8int coml; 01 9int row; 02 0int m; 02 1int n; 02 2bool isend; 02 3bool iswin; 02 4int TF; 02 5void Start () 02 6/width=80*(Screen.width/48
3、0); 02 7width=Screen.width*0.12F; 02 8height=width; 02 9flag=0; 03 0step=0; 03 1row=4; 03 2coml=8; 03 3m=0; 03 4n=0; 03 5iswin=false; 03 6images=new int32; 03 7dires=new Vector432; 03 8TF=new int32; 03 9for(int k=0;k0 18 1if(TF(n-1)*coml+m=1) 18 2m-; 18 3 18 4if(TFn*coml+(m-1)=1) 18 5n-; 18 6 18 7 1
4、8 8 18 9break; 19 0/第四种类型的图片 向右+向下 19 1/ if(diresn*coml+m.y=1 23 2if(TFn*coml+(m-1)=1) 23 3n+; 23 4 23 5if(TF(n+1)*coml+m=1) 23 6m-; 23 7 23 8 23 9 24 024 1break; 24 2 24 324 4if(iswin) 24 5print(“i win dlnuchunge“); 24 6 24 7print(“n:“+n+“-m:“+m); 24 824 9for(int a=0;a32;a+) 25 0print(a+“:“+TFa); 25 1 25 2 25 325 4 25 5