Exemple #1
0
    void Start()
    {
        _mainView = this.GetComponent <UIPanel>().ui;
        GObject holder = _mainView.GetChild("holder");

        _ball = GameObject.Find("Globe").transform;

        FairyGUI.SwipeGesture gesture1 = new FairyGUI.SwipeGesture(holder);
        gesture1.onMove.Add(OnSwipeMove);
        gesture1.onEnd.Add(OnSwipeEnd);

        FairyGUI.LongPressGesture gesture2 = new FairyGUI.LongPressGesture(holder);
        gesture2.once = false;
        gesture2.onAction.Add(OnHold);

        FairyGUI.PinchGesture gesture3 = new FairyGUI.PinchGesture(holder);
        gesture3.onAction.Add(OnPinch);

        FairyGUI.RotationGesture gesture4 = new FairyGUI.RotationGesture(holder);
        gesture4.onAction.Add(OnRotate);
    }
Exemple #2
0
    void Start()
    {
        _mainView = this.GetComponent<UIPanel>().ui;
        GObject holder = _mainView.GetChild("holder");

        _ball = GameObject.Find("Globe").transform;

        FairyGUI.SwipeGesture gesture1 = new FairyGUI.SwipeGesture(holder);
        gesture1.onMove.Add(OnSwipeMove);
        gesture1.onEnd.Add(OnSwipeEnd);

        FairyGUI.LongPressGesture gesture2 = new FairyGUI.LongPressGesture(holder);
        gesture2.once = false;
        gesture2.onAction.Add(OnHold);

        FairyGUI.PinchGesture gesture3 = new FairyGUI.PinchGesture(holder);
        gesture3.onAction.Add(OnPinch);

        FairyGUI.RotationGesture gesture4 = new FairyGUI.RotationGesture(holder);
        gesture4.onAction.Add(OnRotate);
    }
    void Start()
    {
        Application.targetFrameRate = 60;
        GRoot.inst.SetContentScaleFactor(1136, 640);
        Stage.inst.onKeyDown.Add(OnKeyDown);

        UIPackage.AddPackage("UI/Gesture");

        _mainView = UIPackage.CreateObject("Gesture", "Main").asCom;
        _mainView.SetSize(GRoot.inst.width, GRoot.inst.height);
        _mainView.AddRelation(GRoot.inst, RelationType.Size);
        GRoot.inst.AddChild(_mainView);

        GObject holder = _mainView.GetChild("holder");

        _ball = GameObject.Find("Globe").transform;

        SwipeGesture gesture1 = new SwipeGesture(holder);
        gesture1.onMove.Add(OnSwipeMove);
        gesture1.onEnd.Add(OnSwipeEnd);

        LongPressGesture gesture2 = new LongPressGesture(holder);
        gesture2.once = false;
        gesture2.onAction.Add(OnHold);

        PinchGesture gesture3 = new PinchGesture(holder);
        gesture3.onAction.Add(OnPinch);

        RotationGesture gesture4 = new RotationGesture(holder);
        gesture4.onAction.Add(OnRotate);
    }