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); }
protected void updateView() { this.removeAllChildren(); if (vo.isEmpty) { return; } updateEventConnectionUI(); ISkillEvent skillEvent = vo.evt; EditorToggleGroup box; box = new EditorToggleGroup(); box.data = skillEvent; box.addEventListener(EventX.CHANGE, toggleHandle); box.addEventListener(EventX.REPAINT, itemRepaintHandle); Type type; if (eventMaping.TryGetValue(skillEvent.GetType(), out type)) { IEventUI ui = Activator.CreateInstance(type) as IEventUI; box.label = ui.label; box.toggle = skillEvent.enabled; ui.createUI(skillEvent, box); } EditorButton btn = new EditorButton("delete"); btn.style = EditorStyles.miniButton; btn.data = skillEvent; btn.addEventListener(EventX.ITEM_CLICK, deleteHandle); box.addChild(btn); this.addChild(box); }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as GhostEffectEvent; durationSlider = new EditorSlider("duration:"); durationSlider.min = 0.1f; durationSlider.max = 5.0f; durationSlider.value = ev.duration; durationSlider.addEventListener(EventX.CHANGE, durationSliderHandle); intervalSlider = new EditorSlider("interval"); intervalSlider.min = 0.1f; intervalSlider.max = 5.0f; intervalSlider.value = ev.interval; intervalSlider.addEventListener(EventX.CHANGE, intervalSliderHandle); radio = new EditorRadio("onPositionChange:"); radio.selected = ev.onPositionChange; radio.addEventListener(EventX.CHANGE, radioHandle); p.addChild(durationSlider); p.addChild(intervalSlider); p.addChild(radio); }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as EmptyEvent; if (ev == null) { return; } }
void OnSkillEvent(ISkillEvent skillEvent) { if (skillEvent is PlayerSkillAEvent) { Debug.Log("A 技能释放"); } else if (skillEvent is PlayerSkillBEvent) { Debug.Log("B 技能释放"); } }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as MoveEvent; formItem = new EditorVector3("偏移:"); formItem.value = ev.position; formItem.addEventListener(EventX.CHANGE, aniHandle); ridioGroup = new EditorEnumPopUp(); ridioGroup.addEventListener(EventX.CHANGE, ridioGroupHandle); ridioGroup.selectedIndex = ev.type; isInterpolationRidio = new EditorRadio("是否插值"); isInterpolationRidio.selected = ev.isInterpolation; isInterpolationRidio.addEventListener(EventX.CHANGE, isInterpolationHandle); easeType = new EditorEnum("Ease"); //easeType.value = ev.easeType; easeType.addEventListener(EventX.CHANGE, easeTypeHandle); isSpeedRidio = new EditorRadio("是否只按此速度"); isSpeedRidio.visible = isInterpolationRidio.selected; isSpeedRidio.selected = ev.isSpeed; isSpeedRidio.addEventListener(EventX.CHANGE, isSpeedRidioHandle); checkCollideRidio = new EditorRadio("检查碰撞"); checkCollideRidio.selected = ev.checkCollider; checkCollideRidio.addEventListener(EventX.CHANGE, checkCollideRidioHandle); resetRidio = new EditorRadio("播完回复到原位置"); resetRidio.selected = ev.reback; resetRidio.addEventListener(EventX.CHANGE, ridioHandle); p.addChild(ridioGroup); p.addChild(formItem); p.addChild(isInterpolationRidio); p.addChild(easeType); p.addChild(isSpeedRidio); p.addChild(checkCollideRidio); if (isInterpolationRidio.selected == false) { easeType.visible = false; isSpeedRidio.visible = false; } p.addChild(resetRidio); }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as TimeScaleEvent; slider = new EditorSlider(); slider.min = 0.1f; slider.max = 1.0f; slider.value = ev.timeScale; slider.addEventListener(EventX.CHANGE, timeChangeHandle); p.addChild(slider); }
private void toggleHandle(EventX e) { EditorToggleGroup eui = e.target as EditorToggleGroup; ISkillEvent skilEvent = eui.data as ISkillEvent; bool b = EditorUtility.DisplayDialog("提示", "确定要更改状态", "是", "否"); if (b) { skilEvent.enabled = eui.toggle; } else { eui.toggle = skilEvent.enabled; } }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as PlaySoundEvent; heroRadio = new EditorRadio("仅主角"); heroRadio.addEventListener(EventX.CHANGE, radioHandle); heroRadio.selected = ev.isOnlyHero; onceRadio = new EditorRadio("once"); onceRadio.addEventListener(EventX.CHANGE, onceRadioHandle); onceRadio.selected = ev.isOnce; formItem1 = new EditorFormItem("声音1:"); formItem1.addEventListener(EventX.CHANGE, soundHandle1); formItem1.searckKey = DataSource.SOUND; formItem1.value = ev.m_sound1; formItem2 = new EditorFormItem("声音2:"); formItem2.addEventListener(EventX.CHANGE, soundHandle1); formItem2.searckKey = DataSource.SOUND; formItem2.value = ev.m_sound2; formItem3 = new EditorFormItem("声音3:"); formItem3.addEventListener(EventX.CHANGE, soundHandle1); formItem3.searckKey = DataSource.SOUND; formItem3.value = ev.m_sound3; formItem4 = new EditorFormItem("声音4:"); formItem4.addEventListener(EventX.CHANGE, soundHandle1); formItem4.searckKey = DataSource.SOUND; formItem4.value = ev.m_sound4; p.addChild(heroRadio); p.addChild(formItem1); p.addChild(formItem2); p.addChild(formItem3); p.addChild(formItem4); p.addChild(onceRadio); p.windowRepaint(); }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as TrigerEvent; grouGroup = new EditorEnumPopUp(); grouGroup.selectedIndex = ev.type; grouGroup.addEventListener(EventX.CHANGE, ridioGroupHandle); p.addChild(grouGroup); if (SkillEventType.DIY.CompareTo(grouGroup.selectedIndex) == 0) { formItem = new EditorFormItem("事件:"); formItem.value = ev.eventType; formItem.addEventListener(EventX.CHANGE, effectHandle); p.addChild(formItem); } }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as FlashShowEvent; showToggle = new EditorRadio("显示:"); showToggle.selected = ev.isShow; showToggle.addEventListener(EventX.CHANGE, skeletonToggleHandle); offsetFromItem = new EditorVector3("坐标偏移:"); offsetFromItem.addEventListener(EventX.CHANGE, offsetHandle); offsetFromItem.value = ev.offset; offsetFromItem.visible = showToggle.selected; useTargetToggle = new EditorRadio("useTarget:"); useTargetToggle.selected = ev.useTarget; useTargetToggle.addEventListener(EventX.CHANGE, useTargetToggleHandle); p.addChild(showToggle); p.addChild(offsetFromItem); p.addChild(useTargetToggle); }
public virtual void drawPoint(SkillPointVO pointVo, SkillLineVO lineVo, Rect r, Texture2D texture2D) { ISkillEvent e = pointVo.evt; if (pointVo.evt is EmptyEvent) { GUI.color = Color.red; } else { if (e.enabled == false || lineVo.enabled == false) { GUI.color = Color.gray; } else { GUI.color = defaultPointColor; } } GUI.DrawTexture(r, texture2D); GUI.color = Color.white; }
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 override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as SetAnimationBoolEvent; formItem = new EditorFormItem("参数:"); formItem.searckKey = DataSource.ANIMATION_PARMS; formItem.value = ev.key; formItem.addEventListener(EventX.CHANGE, aniHandle); valueRedio = new EditorRadio("值:"); valueRedio.selected = ev.value; valueRedio.addEventListener(EventX.CHANGE, valueHandle); isResetRidio = new EditorRadio("播完重置:"); isResetRidio.selected = ev.resetDefault; isResetRidio.addEventListener(EventX.CHANGE, resetHandle); p.addChild(formItem); p.addChild(valueRedio); p.addChild(isResetRidio); }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); ev = value as CameraMoveEvent; formItem = new EditorVector3("偏移:"); formItem.value = ev.position; formItem.addEventListener(EventX.CHANGE, formHandle); checkRadio = new EditorRadio("获取焦点"); checkRadio.selected = ev.focusGet; checkRadio.addEventListener(EventX.CHANGE, checkRadioHandle); if (checkRadio.selected) { forceRadio = new EditorRadio("强转"); forceRadio.selected = ev.forceChange; forceRadio.addEventListener(EventX.CHANGE, checkRadioHandle); } p.addChild(formItem); p.addChild(checkRadio); }
public void DoEvent(SkillEvent skillEvent, IBattle battle, IHeroFSM selfFSM, IHeroFSM targetFSM) { ISkillEvent _event = null; var cd = this.GetCalssData(skillEvent.EventName); if (cd != null) { _event = Activator.CreateInstance(cd.Type, skillEvent) as ISkillEvent; } // if (_event != null) { BDebug.Log("执行skillEvent:" + skillEvent.EventName); _event.Do(battle, selfFSM, targetFSM); } else { BDebug.LogError("未找到技能事件:" + skillEvent.EventName); } }
public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); this.ev = value as EffectCreateEvent; effectFormItem = new EditorFormItem("特效:"); effectFormItem.value = ev.effectPath; effectFormItem.addEventListener(EventX.CHANGE, effectHandle); effectFormItem.searckKey = DataSource.EFFECT; p.addChild(effectFormItem); skeletonToggle = new EditorRadio("绑定身体:"); skeletonToggle.selected = ev.isBindSkeleton; skeletonToggle.addEventListener(EventX.CHANGE, skeletonToggleHandle); bindOnceToggle = new EditorRadio("一次性对位而已:"); bindOnceToggle.selected = ev.isBindOnce; bindOnceToggle.addEventListener(EventX.CHANGE, bindOnceToggleHandle); bindOnceToggle.visible = ev.isBindSkeleton; skeletonFormItem = new EditorFormItem("骨骼:"); skeletonFormItem.value = ev.skeletonName; skeletonFormItem.addEventListener(EventX.CHANGE, skeletonNameHandle); skeletonFormItem.searckKey = DataSource.BONE; skeletonFormItem.visible = ev.isBindSkeleton; skeletonFormItem.visible = skeletonToggle.selected; offsetFromItem = new EditorVector3("坐标偏移:"); offsetFromItem.addEventListener(EventX.CHANGE, offsetHandle); offsetFromItem.value = ev.offset; rotationFromItem = new EditorVector3("坐标旋转:"); rotationFromItem.addEventListener(EventX.CHANGE, rotationHandle); rotationFromItem.value = ev.offRotation; useTargetToggle = new EditorRadio("useTarget:"); useTargetToggle.selected = ev.useTarget; useTargetToggle.addEventListener(EventX.CHANGE, useTargetToggleHandle); isColliderToggle = new EditorRadio("isCollider:"); isColliderToggle.selected = ev.isCollider; isColliderToggle.addEventListener(EventX.CHANGE, isColliderToggleHandle); isUseTargetLayerToggle = new EditorRadio("useTargetLayer:"); isUseTargetLayerToggle.selected = ev.useTargetLayer; isUseTargetLayerToggle.addEventListener(EventX.CHANGE, isUseTargetLayerHandle); particlePlaybackSpeedSlider = new EditorSlider("SpeedScale:"); particlePlaybackSpeedSlider.min = 0.1f; particlePlaybackSpeedSlider.max = 5.0f; particlePlaybackSpeedSlider.value = ev.particlePlaybackSpeed; particlePlaybackSpeedSlider.addEventListener(EventX.CHANGE, particlePlaybackSpeedHandle); p.addChild(skeletonToggle); p.addChild(bindOnceToggle); p.addChild(skeletonFormItem); p.addChild(offsetFromItem); p.addChild(rotationFromItem); p.addChild(useTargetToggle); p.addChild(isColliderToggle); p.addChild(isUseTargetLayerToggle); p.addChild(particlePlaybackSpeedSlider); }
//private SkillUseEvent ev; public override void createUI(ISkillEvent value, EditorUI p) { base.createUI(value, p); }
public virtual void createUI(ISkillEvent value, EditorUI p) { this.e = value; this.p = p; }