예제 #1
0
    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;
    }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
    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;
    }
예제 #5
0
 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;
 }
예제 #6
0
    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;
    }