public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as CameraShakeEvent; slider = new EditorSlider("幅度:"); slider.setRank(0.1f, 10.0f, 0.1f); slider.value = ev.factor; slider1 = new EditorSlider("周期:"); slider1.setRank(0.1f, 10.0f, 1); slider1.value = ev.period; formItem = new EditorVector3("偏移:"); formItem.value = ev.shaderVector; formItem.addEventListener(EventX.CHANGE, formHandle); slider.addEventListener(EventX.CHANGE, changeHandle); slider1.addEventListener(EventX.CHANGE, changeHandle1); p.addChild(slider); p.addChild(slider1); p.addChild(formItem); }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as PlayAnimEvent; formItem = new EditorFormItem("动画:"); formItem.searckKey = DataSource.ANIMATION; formItem.value = ev.aniName; formItem.addEventListener(EventX.CHANGE, aniHandle); isForceRidio = new EditorRadio("是否强制切换:"); isForceRidio.selected = ev.isForce; isForceRidio.addEventListener(EventX.CHANGE, isForceRidioHandle); offsetSlider = new EditorSlider("偏移:"); offsetSlider.setRank(0f, 1.0f, ev.offsetAvg); offsetSlider.value = ev.offsetAvg; offsetSlider.addEventListener(EventX.CHANGE, sliderHandle); p.addChild(formItem); p.addChild(isForceRidio); p.addChild(offsetSlider); }
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); }