Exemplo n.º 1
0
        /// <inheritdoc />
        protected override void OnContextMenu(ContextMenu.ContextMenu menu)
        {
            base.OnContextMenu(menu);

            menu.AddSeparator();
            AddContextMenu(menu, 0.0f);
        }
Exemplo n.º 2
0
        private void OnAddButtonClicked(Button button)
        {
            var cm = new ContextMenu.ContextMenu();

            OnContextMenu(cm);
            cm.Show(button.Parent, button.BottomLeft);
        }
Exemplo n.º 3
0
 public OpenFile(OculusTouch oculusTouch,
                 ContextMenu.ContextMenu contextMenu,
                 DataHandler dataHandler,
                 List <Curve> curves)
     : base(oculusTouch, contextMenu, dataHandler, curves)
 {
     base.NumberOfUnselectableItems = 4;
 }
Exemplo n.º 4
0
 public State(OculusTouch oculusTouch, ContextMenu.ContextMenu contextMenu, DataHandler dataHandler, List <Curve> curves)
 {
     this.oculusTouch = oculusTouch;
     this.contextMenu = contextMenu;
     this.dataHandler = dataHandler;
     this.SetupMenu();
     this.curves   = curves;
     this.epsilon  = this.segment * 0.2f;
     this.newState = null;
 }
Exemplo n.º 5
0
        private void AddContextMenu(ContextMenu.ContextMenu menu, float time)
        {
            var addEvent           = menu.AddChildMenu("Add Anim Event");
            var addContinuousEvent = menu.AddChildMenu("Add Anim Continuous Event");
            var animEventTypes     = Editor.Instance.CodeEditing.All.Get().Where(x => new ScriptType(typeof(AnimEvent)).IsAssignableFrom(x));

            foreach (var type in animEventTypes)
            {
                if (type.IsAbstract || !type.CanCreateInstance)
                {
                    continue;
                }
                var add = new ScriptType(typeof(AnimContinuousEvent)).IsAssignableFrom(type) ? addContinuousEvent : addEvent;
                var b   = add.ContextMenu.AddButton(type.Name);
                b.TooltipText    = Surface.SurfaceUtils.GetVisualScriptTypeDescription(type);
                b.Tag            = type;
                b.Parent.Tag     = time;
                b.ButtonClicked += OnAddAnimEvent;
            }
        }
Exemplo n.º 6
0
    void Start()
    {
        this.oculusTouch = new OculusTouch
                           (
            buttonMap: LiteralKeysPlus,
            leftStickKey: PredefinedMaps.Arrows,
            rightHandKey: PredefinedMaps.OKLSemiIComma,
            handScale: 0.03f,
            handSpeed: 0.01f
                           );

        this.comfirmBotton = LogicalOVRInput.RawButton.X;
        this.contextMenu   = new ContextMenu.ContextMenu(
            this.oculusTouch,
            upButton: LogicalOVRInput.RawButton.LStickUp,
            downButton: LogicalOVRInput.RawButton.LStickDown,
            confirmButton: comfirmBotton,
            toggleMenuButton: LogicalOVRInput.RawButton.LIndexTrigger,
            lockLevel: null
            );
        this.contextMenu.AddItem(new MenuItem("左人差し指 : メニューウィンドウの開閉", () => {}));
        this.contextMenu.AddItem(new MenuItem("左スティック : カーソルの移動", () => {}));
        this.contextMenu.AddItem(new MenuItem("Xボタン : メニューでの決定ボタン", () => {}));
        this.contextMenu.AddItem(new MenuItem("", () => {}));
        this.contextMenu.Open();

        this.dataHandler = new DataHandler(
            inputDirOnPC: "CurveData",
            outputDirOnPC: "CurveData",
            cacheDirOnPC: "CurveData",
            inputDirOnHMD: "/mnt/sdcard/CurveData",
            outputDirOnHMD: "/mnt/sdcard/CurveData",
            cacheDirOnHMD: "/mnt/sdcard/CurveData"
            );

        this.state = new BasicDeformation(this.oculusTouch, this.contextMenu, this.dataHandler, new List <Curve>(), comfirm: comfirmBotton);
    }
Exemplo n.º 7
0
    public BasicDeformation(OculusTouch oculusTouch,
                            ContextMenu.ContextMenu contextMenu,
                            DataHandler dataHandler,
                            List <Curve> curves,
                            LogicalButton changeState = null,
                            LogicalButton draw        = null,
                            LogicalButton move        = null,
                            LogicalButton select      = null,
                            LogicalButton cut         = null,
                            LogicalButton comfirm     = null)
        : base(oculusTouch, contextMenu, dataHandler, curves)
    {
        base.NumberOfUnselectableItems = 9;
        this.preCurves    = base.curves;
        this.drawingCurve = new Curve(new List <Vector3>(), false);
        this.movingCurves = new List <int>();

        if (draw != null)
        {
            this.draw = draw;
        }
        else
        {
            this.draw = LogicalOVRInput.RawButton.RIndexTrigger;
        }

        if (move != null)
        {
            this.move = move;
        }
        else
        {
            this.move = LogicalOVRInput.RawButton.RHandTrigger;
        }

        if (select != null)
        {
            this.select = select;
        }
        else
        {
            this.select = LogicalOVRInput.RawButton.A;
        }

        if (cut != null)
        {
            this.cut = cut;
        }
        else
        {
            this.cut = LogicalOVRInput.RawButton.B;
        }

        if (comfirm != null)
        {
            this.comfirm = comfirm;
        }
        else
        {
            this.comfirm = LogicalOVRInput.RawButton.X;
        }

        Curve.SetUp(base.oculusTouch, this.draw, this.move);
    }
Exemplo n.º 8
0
        /// <inheritdoc />
        public override void OnTimelineContextMenu(ContextMenu.ContextMenu menu, float time)
        {
            base.OnTimelineContextMenu(menu, time);

            AddContextMenu(menu, time);
        }