void Start() { _needImage = GameObject.Find("Canvas").transform.Find("needImg").GetComponent <Image>(); _CursorImg1 = GameObject.Find("Canvas").transform.Find("Cursor1").GetComponent <Image>(); _CursorImg2 = GameObject.Find("Canvas").transform.Find("Cursor1/Cursor2").GetComponent <Image>(); EventTriggerListener.BindPass(_needImage.gameObject).onEnter = OnEnter; }
void Start() { plane = GameObject.Find("Plane"); Gun = GameObject.Find("Gun"); People = GameObject.Find("People"); //EventTriggerListener.Bind(plane.Go).onClick = OnClick; //EventTriggerListener.Bind(Gun.Go).onClick = OnClick; //EventTriggerListener.Bind(People.Go).onClick = OnClick; EventTriggerListener.BindPass(plane.gameObject).onClick = OnClick; EventTriggerListener.BindPass(Gun.gameObject).onClick = OnClick; EventTriggerListener.BindPass(People.gameObject).onClick = OnClick; }
void Start() { //EventTriggerListener.Bind(ui1.Go).onClick = OnClick; //EventTriggerListener.Bind(ui2.Go).onClick = OnClick; //EventTriggerListener.Bind(cube1.Go).onClick = OnClick; //EventTriggerListener.Bind(cube2.Go).onClick = OnClick; //EventTriggerListener.Bind(spt1.Go).onClick = OnClick; //EventTriggerListener.Bind(spt2.Go).onClick = OnClick; EventTriggerListener.Bind(ui1.gameObject).onEnter = OnEnter; EventTriggerListener.BindPass(ui1.gameObject).onClick = OnClick; EventTriggerListener.BindPass(ui2.gameObject).onClick = OnClick; EventTriggerListener.BindPass(cube1.gameObject).onClick = OnClick; EventTriggerListener.BindPass(cube2.gameObject).onClick = OnClick; EventTriggerListener.BindPass(spt1.gameObject).onClick = OnClick; EventTriggerListener.BindPass(spt2.gameObject).onClick = OnClick; }
void Start() { Restext = GameObject.Find("Canvas/Restext").GetComponent <Text>(); posX = GameObject.Find("Canvas/posX").GetComponent <InputField>(); posY = GameObject.Find("Canvas/posY").GetComponent <InputField>(); posY.onEndEdit.AddListener(PosCallBack); plane = GameObject.Find("Plane"); Gun = GameObject.Find("Gun"); People = GameObject.Find("People"); //EventTriggerListener.Bind(plane.Go).onClick = OnClick; //EventTriggerListener.Bind(Gun.Go).onClick = OnClick; //EventTriggerListener.Bind(People.Go).onClick = OnClick; EventTriggerListener.BindPass(plane.gameObject).onClick = OnClick; EventTriggerListener.BindPass(Gun.gameObject).onClick = OnClick; EventTriggerListener.BindPass(People.gameObject).onClick = OnClick; }
private void Start() { ui1 = GameObject.Find("Canvas/ui1").GetComponent <Image>(); ui2 = GameObject.Find("Canvas/ui2").GetComponent <Image>(); cube = GameObject.Find("cube"); sprite = GameObject.Find("sprite"); //// 绑定自定义委托 // 点击 EventTriggerListener.BindPass(ui1.gameObject).onClick = OnClickHandler; EventTriggerListener.BindPass(ui2.gameObject).onClick = OnClickHandler; EventTriggerListener.BindPass(cube.gameObject).onClick = OnClickHandler; EventTriggerListener.BindPass(sprite.gameObject).onClick = OnClickHandler; //// 拖动 //EventTriggerListener.BindPass(ui1.gameObject).onDrag = OnDragHandler; //EventTriggerListener.BindPass(ui2.gameObject).onDrag = OnDragHandler; //EventTriggerListener.BindPass(cube.gameObject).onDrag = OnDragHandler; //EventTriggerListener.BindPass(sprite.gameObject).onDrag = OnDragHandler; //// 进入 //EventTriggerListener.BindPass(ui1.gameObject).onEnter = OnEnterHandler; //EventTriggerListener.BindPass(ui2.gameObject).onEnter = OnEnterHandler; //EventTriggerListener.BindPass(cube.gameObject).onEnter = OnEnterHandler; //EventTriggerListener.BindPass(sprite.gameObject).onEnter = OnEnterHandler; //// 离开 //EventTriggerListener.BindPass(ui1.gameObject).onExit = OnExitHandler; //EventTriggerListener.BindPass(ui2.gameObject).onExit = OnExitHandler; //EventTriggerListener.BindPass(cube.gameObject).onExit = OnExitHandler; //EventTriggerListener.BindPass(sprite.gameObject).onExit = OnExitHandler; //// 按下 //EventTriggerListener.BindPass(ui1.gameObject).onDown = OnDownHandler; //EventTriggerListener.BindPass(ui2.gameObject).onDown = OnDownHandler; //EventTriggerListener.BindPass(cube.gameObject).onDown = OnDownHandler; //EventTriggerListener.BindPass(sprite.gameObject).onDown = OnDownHandler; //// 弹起 //EventTriggerListener.BindPass(ui1.gameObject).onUp = OnUpHandler; //EventTriggerListener.BindPass(ui2.gameObject).onUp = OnUpHandler; //EventTriggerListener.BindPass(cube.gameObject).onUp = OnUpHandler; //EventTriggerListener.BindPass(sprite.gameObject).onUp = OnUpHandler; }
private void Start() { Restext = GameObject.Find("Canvas/Restext").GetComponent <Text>(); posX = GameObject.Find("Canvas/posX").GetComponent <InputField>(); posY = GameObject.Find("Canvas/posY").GetComponent <InputField>(); ui1 = GameObject.Find("Canvas/ui1").GetComponent <Image>(); ui2 = GameObject.Find("Canvas/ui2").GetComponent <Image>(); cube = GameObject.Find("Canvas/cube"); sprite = GameObject.Find("Canvas/sprite"); posY.onEndEdit.AddListener(PosCallBack); //// 绑定自定义委托 //EventTriggerListener.Bind(ui1.Go).onClick = OnClickHandler; //EventTriggerListener.Bind(ui2.Go).onClick = OnClickHandler; //EventTriggerListener.Bind(cube.Go).onClick = OnClickHandler; //EventTriggerListener.Bind(sprite.Go).onClick = OnClickHandler; //// 拖动 //EventTriggerListener.Bind(ui1.Go).onDrag = OnDragHandler; //EventTriggerListener.Bind(ui2.Go).onDrag = OnDragHandler; //EventTriggerListener.Bind(cube.Go).onDrag = OnDragHandler; //EventTriggerListener.Bind(sprite.Go).onDrag = OnDragHandler; //// 进入 //EventTriggerListener.Bind(ui1.Go).onEnter = OnEnterHandler; //EventTriggerListener.Bind(ui2.Go).onEnter = OnEnterHandler; //EventTriggerListener.Bind(cube.Go).onEnter = OnEnterHandler; //EventTriggerListener.Bind(sprite.Go).onEnter = OnEnterHandler; //// 离开 //EventTriggerListener.Bind(ui1.Go).onExit = OnExitHandler; //EventTriggerListener.Bind(ui2.Go).onExit = OnExitHandler; //EventTriggerListener.Bind(cube.Go).onExit = OnExitHandler; //EventTriggerListener.Bind(sprite.Go).onExit = OnExitHandler; //// 按下 //EventTriggerListener.Bind(ui1.Go).onDown = OnDownHandler; //EventTriggerListener.Bind(ui2.Go).onDown = OnDownHandler; //EventTriggerListener.Bind(cube.Go).onDown = OnDownHandler; //EventTriggerListener.Bind(sprite.Go).onDown = OnDownHandler; //// 弹起 //EventTriggerListener.Bind(ui1.Go).onUp = OnUpHandler; //EventTriggerListener.Bind(ui2.Go).onUp = OnUpHandler; //EventTriggerListener.Bind(cube.Go).onUp = OnUpHandler; //EventTriggerListener.Bind(sprite.Go).onUp = OnUpHandler; //// 绑定自定义委托 // 点击 EventTriggerListener.BindPass(ui1.gameObject).onClick = OnClickHandler; EventTriggerListener.BindPass(ui2.gameObject).onClick = OnClickHandler; EventTriggerListener.BindPass(cube.gameObject).onClick = OnClickHandler; EventTriggerListener.BindPass(sprite.gameObject).onClick = OnClickHandler; // 拖动 EventTriggerListener.BindPass(ui1.gameObject).onDrag = OnDragHandler; EventTriggerListener.BindPass(ui2.gameObject).onDrag = OnDragHandler; EventTriggerListener.BindPass(cube.gameObject).onDrag = OnDragHandler; EventTriggerListener.BindPass(sprite.gameObject).onDrag = OnDragHandler; // 进入 EventTriggerListener.BindPass(ui1.gameObject).onEnter = OnEnterHandler; EventTriggerListener.BindPass(ui2.gameObject).onEnter = OnEnterHandler; EventTriggerListener.BindPass(cube.gameObject).onEnter = OnEnterHandler; EventTriggerListener.BindPass(sprite.gameObject).onEnter = OnEnterHandler; // 离开 EventTriggerListener.BindPass(ui1.gameObject).onExit = OnExitHandler; EventTriggerListener.BindPass(ui2.gameObject).onExit = OnExitHandler; EventTriggerListener.BindPass(cube.gameObject).onExit = OnExitHandler; EventTriggerListener.BindPass(sprite.gameObject).onExit = OnExitHandler; // 按下 EventTriggerListener.BindPass(ui1.gameObject).onDown = OnDownHandler; EventTriggerListener.BindPass(ui2.gameObject).onDown = OnDownHandler; EventTriggerListener.BindPass(cube.gameObject).onDown = OnDownHandler; EventTriggerListener.BindPass(sprite.gameObject).onDown = OnDownHandler; // 弹起 EventTriggerListener.BindPass(ui1.gameObject).onUp = OnUpHandler; EventTriggerListener.BindPass(ui2.gameObject).onUp = OnUpHandler; EventTriggerListener.BindPass(cube.gameObject).onUp = OnUpHandler; EventTriggerListener.BindPass(sprite.gameObject).onUp = OnUpHandler; }