public EditorVector(string label = "v:") : base(false) { this.valueTF = new EditorLabel(); this.valueTF.expandWidth = false; this.valueTF.minWidth = 20; this.valueTF.addEventListener(EventX.CHANGE, this.textHandle, 0); this.silder = new EditorSlider(label); this.silder.addEventListener(EventX.CHANGE, this.silderHandle, 0); base.addChild(this.silder); base.addChild(this.valueTF); this.value = 0f; }
public TimeWindow() { this.styleString = "PreBackground"; EditorBox box = new EditorBox(false); box.styleString = "box"; EditorButton newButton = new EditorButton("创建"); newButton.styleString = "ButtonLeft"; newButton.expandWidth = false; newButton.addEventListener(EventX.ITEM_CLICK, newHandle); box.addChild(newButton); EditorButton button = new EditorButton("加载"); button.styleString = "ButtonMid"; button.expandWidth = false; button.addEventListener(EventX.ITEM_CLICK, loadHandle); box.addChild(button); button = new EditorButton("保存"); button.styleString = "ButtonMid"; button.expandWidth = false; button.addEventListener(EventX.ITEM_CLICK, saveHandle); box.addChild(button); button = new EditorButton("另存"); button.styleString = "ButtonMid"; button.expandWidth = false; button.addEventListener(EventX.ITEM_CLICK, toSaveHandle); box.addChild(button); playButton = new EditorButton("播放"); playButton.styleString = "ButtonRight"; playButton.expandWidth = false; playButton.addEventListener(EventX.ITEM_CLICK, toggleHandle); box.addChild(playButton); EditorPlayControlBar cb = new EditorPlayControlBar(); box.addChild(cb); box.addChild(new EditorSpace()); fileNameButton = new EditorButton(); fileNameButton.expandWidth = false; fileNameButton.addEventListener(EventX.ITEM_CLICK, openPathHandle); box.addChild(fileNameButton); fileNameButton.visible = false; commitButton = new EditorButton("提交"); commitButton.expandWidth = false; commitButton.addEventListener(EventX.ITEM_CLICK, commitPathHandle); box.addChild(commitButton); commitButton.visible = false; timeScaleSlider = new EditorSlider("时间缩放"); timeScaleSlider.setRank(0.1f, 2f, 1.0f); timeScaleSlider.widthOption = GUILayout.Width(200); timeScaleSlider.addEventListener(EventX.CHANGE, timeScaleHandle); box.addChild(timeScaleSlider); this.addChild(box); EditorButton resetButton = new EditorButton("reset"); resetButton.expandWidth = false; resetButton.addEventListener(EventX.ITEM_CLICK, resetTimeHandle); box.addChild(resetButton); EditorLabel label = new EditorLabel("fps:" + (int)(1000 / frameTime) + "帧/s"); box.addChild(label); timeLine = new TimeLine(); timeLine.genericMenuEditorCallBack = genericMenuEditorCallBack; timeLine.addMenuEditorCallBack = addMenuEditorCallBack; timeLine.addEventListener(EventX.SELECT, innerDirectDispatchEvent); skillListBox = new EditorBox(true); this.addChild(timeLine); this.addChild(skillListBox); }