public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { switch ((Conditon)func.intParam0) { case Conditon.Direct: fight.SetForceClear(); break; case Conditon.Jump_Fall: if (fight.Jump_IsFall()) { fight.SetForceClear(); } break; case Conditon.Jump_Floor: if (fight.Jump_IsFloor()) { fight.SetForceClear(); /* Debug.Log("setzero!");*/ } break; default: break; } return(false); }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { WhenExit exit = (WhenExit)func.intParam0; bool active = false; if (exit == WhenExit.Direct) { active = true; } else if (exit == WhenExit.Jump_Fall && fight.Jump_IsFall()) { active = true; } else if (exit == WhenExit.Jump_Floor && fight.Jump_IsFloor()) { active = true; } else if (exit == WhenExit.Attack && fight.IsHit()) { active = true; } else if (exit == WhenExit.NotAttack && !fight.IsHit()) { active = true; } if (active) { fight.PlaySound(func.strParam0); return(true); } return(false); }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是配置func_flyitem", MessageType.Info); func.intParam0 = EditorGUILayout.IntField("HP", func.intParam0); func.intParam1 = EditorGUILayout.IntField("Life", func.intParam1); func.strParam0 = EditorGUILayout.TextField("飞行道具", func.strParam0); func.vecParam0 = EditorGUILayout.Vector3Field("加力", func.vecParam0); }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是执行并转身,这个功能最好用1帧的", MessageType.Info); //if(func.activeFrameBegin) //{ // func.activeFrameBegin = -1; // EditorUtility.SetDirty(Window_StateTable.stateTable); //} }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { //四个效果 //int0 dark screen //int1 焦点(镜头放大跟踪) //int2 暂停世界(除了我) //int3 摇晃摄像机 fight.WorldEffect(func.intParam0 > 0, func.intParam1 > 0, func.intParam2 > 0, func.intParam3 > 0); return(false); }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是检测输入并跳出Block", MessageType.Info); func.haveexit = true; { var text = EditorGUILayout.TextField("输入指令", func.strParam0.ToUpper()); if (text != func.strParam0) { func.strParam0 = text; EditorUtility.SetDirty(Window_StateTable.stateTable); } } func.vecParam0.x = EditorGUILayout.FloatField("指令时间:", func.vecParam0.x); bool isHitOn = (func.intParam1 == 1) ? true : false; isHitOn = EditorGUILayout.Toggle("是否击中:", isHitOn); func.intParam1 = (isHitOn) ? 1 : 0; GUILayout.BeginHorizontal(); { List <string> tempstr = new List <string>(); for (int i = 0; i < Window_StateTable.selectBlock.exits.Count; i++) { tempstr.Add(i.ToString()); } string butt_str = "选择"; if (GUILayout.Button(butt_str, GUILayout.Width(80))) { //如果此block没有配置exit就会添加一个next的选项最终会指向下一个block Window_PickExit.ShowExitFunc((exit) => { exitfunc = exit; }); } if (exitfunc != null) { if (exitfunc != null) { func.strParam1 = exitfunc.statename; func.intParam0 = exitfunc.blockindex; } } EditorUtility.SetDirty(Window_StateTable.stateTable); } GUILayout.EndHorizontal(); GUILayout.BeginVertical(); GUILayout.Label("跳出到状态: " + func.strParam1); GUILayout.Label("blockIndex: " + func.intParam0.ToString()); GUILayout.EndVertical(); }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是移动,有两种模式,分别有不同的参数", MessageType.Info); int mode = 0; if (func.strParam0 == "byjoy") { mode = 0; } else if (func.strParam0 == "byvec") { mode = 1; } else { func.strParam0 = "byjoy"; EditorUtility.SetDirty(Window_StateTable.stateTable); mode = 0; } int mode2 = GUILayout.Toolbar(mode, new string[] { "跟随摇杆", "固定向量" }); if (mode2 != mode) { if (mode2 == 0) { func.strParam0 = "byjoy"; } else if (mode2 == 1) { func.strParam0 = "byvec"; } EditorUtility.SetDirty(Window_StateTable.stateTable); } if (mode2 == 0) { float speed = EditorGUILayout.FloatField("摇杆运动速度,参考值为1(米每秒)", func.vecParam0.x); if (speed != func.vecParam0.x) { func.vecParam0.x = speed; EditorUtility.SetDirty(Window_StateTable.stateTable); } } else if (mode2 == 1) { Vector3 move = EditorGUILayout.Vector3Field("移动增量(每帧增量)", func.vecParam0); Vector3 srcmove = func.vecParam0; if (move != srcmove) { func.vecParam0 = move; EditorUtility.SetDirty(Window_StateTable.stateTable); } } }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是配置func_forceclear", MessageType.Info); var exit = (FB.FFSM.BlockParser_WhenExit.WhenExit)func.intParam0; exit = (FB.FFSM.BlockParser_WhenExit.WhenExit)EditorGUILayout.EnumPopup("条件", exit); if ((int)exit != func.intParam0) { func.intParam0 = (int)exit; EditorUtility.SetDirty(Window_StateTable.stateTable); } }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是攻击判定", MessageType.Info); func.haveexit = string.IsNullOrEmpty(func.strParam1); GUILayout.BeginVertical(); bool ishit = (func.intParam3 == 1) ? true : false; ishit = EditorGUILayout.Toggle("是否击中", ishit); func.intParam3 = (ishit) ? 1 : 0; func.strParam0 = EditorGUILayout.TextField("属性:", func.strParam0); FB.FFSM.BlockParser_PropExit.PropOp exit = (FB.FFSM.BlockParser_PropExit.PropOp)func.intParam2; exit = (FB.FFSM.BlockParser_PropExit.PropOp)EditorGUILayout.EnumPopup(exit); if ((int)exit != func.intParam2) { func.intParam2 = (int)exit; } func.intParam1 = EditorGUILayout.IntField("数值:", func.intParam1); GUILayout.BeginHorizontal(); { List <string> tempstr = new List <string>(); for (int i = 0; i < Window_StateTable.selectBlock.exits.Count; i++) { tempstr.Add(i.ToString()); } string butt_str = "选择"; if (GUILayout.Button(butt_str, GUILayout.Width(80))) { //如果此block没有配置exit就会添加一个next的选项最终会指向下一个block Window_PickExit.ShowExitFunc((_exit) => { exitfunc = _exit; }); } if (exitfunc != null) { func.strParam1 = exitfunc.statename; func.intParam0 = exitfunc.blockindex; } } //int id = EditorGUILayout.IntField(_selectBlock.exits[ie].blockindex, GUILayout.Width(120)); GUILayout.EndHorizontal(); GUILayout.Label("跳出到状态: " + func.strParam1); GUILayout.Label("blockIndex: " + func.intParam0.ToString()); GUILayout.EndVertical(); }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是攻击判定", MessageType.Info); func.haveexit = false; FixInt("攻击可命中多少敌人", ref func.intParam0); FixInt("命中HitCount", ref func.intParam1); GUILayout.Space(10); FixString("攻击影响参数", ref func.strParam0); FixInt("攻击影响值", ref func.intParam2); GUILayout.Space(10); GUILayout.BeginHorizontal(); GUILayout.Label("攻击导致对方状态", GUILayout.Width(145)); if (GUILayout.Button(func.strParam1)) { //Window_StateLeadState.Show(Window_StateTable.StateTree.states, (str) => { // func.strParam1 = str; // EditorUtility.SetDirty(Window_StateTable.stateTable); //},false); List <string> allBehurtStates = new List <string>(); foreach (var item in Window_StateTable.stateTable.allBehurtStates) { allBehurtStates.Add(item.name); } Window_PickAny.ShowAny(allBehurtStates, (str) => { BeHurtState = str; }); } if (!string.IsNullOrEmpty(BeHurtState)) { func.strParam1 = BeHurtState; BeHurtState = null; } GUILayout.EndHorizontal(); int nhold = GUILayout.Toggle(func.intParam3 > 0, "是否具有抓持效果") ? 1 : 0; if (nhold != func.intParam3) { func.intParam3 = nhold; EditorUtility.SetDirty(Window_StateTable.stateTable); } int nhurt = GUILayout.Toggle(func.intParam4 > 0, "是否伤害队友") ? 1 : 0; if (nhurt != func.intParam4) { func.intParam4 = nhurt; EditorUtility.SetDirty(Window_StateTable.stateTable); } }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是检测输入并跳出Block", MessageType.Info); func.haveexit = true; func.haveexit = true; { FB.FFSM.BlockParser_WhenExit.WhenExit exit = (FB.FFSM.BlockParser_WhenExit.WhenExit)func.intParam1; var exit2 = (FB.FFSM.BlockParser_WhenExit.WhenExit)EditorGUILayout.EnumPopup("条件", exit); if (exit2 != exit) { func.intParam1 = (int)exit2; EditorUtility.SetDirty(Window_StateTable.stateTable); } } GUILayout.BeginHorizontal(); { List <string> tempstr = new List <string>(); for (int i = 0; i < Window_StateTable.selectBlock.exits.Count; i++) { tempstr.Add(i.ToString()); } string butt_str = "选择"; if (GUILayout.Button(butt_str, GUILayout.Width(80))) { //如果此block没有配置exit就会添加一个next的选项最终会指向下一个block Window_PickExit.ShowExitFunc((exit) => { exitfunc = exit; }); } if (exitfunc != null) { func.strParam1 = exitfunc.statename; func.intParam0 = exitfunc.blockindex; exitfunc = null; } EditorUtility.SetDirty(Window_StateTable.stateTable); } GUILayout.EndHorizontal(); GUILayout.BeginVertical(); GUILayout.Label("跳出到状态: " + func.strParam1); GUILayout.Label("blockIndex: " + func.intParam0.ToString()); GUILayout.EndVertical(); }
//public bool Init(IFightFSM fight, BlockFunc func) //{ // //fight.Turn(); // return false; //} public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { //限制功能激活时间 //if(func.activeFrameBegin<0||frameindex<func.activeFrameBegin)return false; //if(func.activeFrameEnd>=0&&frameindex>func.activeFrameEnd)return false; if (func.intParam1 == 1 && !fight.IsHit()) //是否攻击中 { // Debug.Log("false"); return(false); } fight.SetRepeatExit(func.strParam1, func.intParam0, func.intParam2); return(false); }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是配置func_force", MessageType.Info); bool bisclearforce = (func.intParam0 == 1) ? true : false; bisclearforce = EditorGUILayout.Toggle("是否清除力", bisclearforce); func.intParam0 = (bisclearforce) ? 1 : 0; bool bisjumpwithfix = (func.intParam1 == 1) ? true : false; bisjumpwithfix = EditorGUILayout.Toggle("摇杆移动", bisjumpwithfix); func.intParam1 = (bisjumpwithfix) ? 1 : 0; func.vecParam0 = EditorGUILayout.Vector3Field("速度", func.vecParam0); }
//public bool Init(IFightFSM fight, BlockFunc func) //{ // //fight.Turn(); // return false; //} public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { ////限制功能激活时间,外部限制去 //if(func.activeFrameBegin<0||frameindex<func.activeFrameBegin)return false; //if(func.activeFrameEnd>=0&&frameindex>func.activeFrameEnd)return false; if (func.strParam0 == "byjoy") { fight.MoveByJoy(func.vecParam0.x); } else if (func.strParam0 == "byvec") { fight.Move(func.vecParam0.x, func.vecParam0.y, func.vecParam0.z); /* Debug.Log("move:" + func.vecParam0);*/ } return(false); }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { fight.FlashBegin(new Color(func.vecParam0.x, func.vecParam0.y, func.vecParam0.z, func.vecParam0.z), func.intParam0, func.intParam1); ////FixInt("攻击可命中多少敌人", ref func.intParam0); ////FixInt("命中HitCount", ref func.intParam1); ////GUILayout.Space(10); ////FixString("攻击影响参数", ref func.strParam0); ////FixInt("攻击影响值", ref func.intParam2); ////GUILayout.Space(10); ////FixString("攻击导致对方状态", ref func.strParam1); ////if (func.activeFrameBegin < 0 || frameindex < func.activeFrameBegin) return false; ////if (func.activeFrameEnd >= 0 && frameindex > func.activeFrameEnd) return false; //fight.FE_AddHit(func.intParam0,func.intParam1,func.strParam0, func.intParam2, func.strParam1); return(false); }
//public bool Init(IFightFSM fight, BlockFunc func) //{ // //fight.Turn(); // return false; //} public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { //限制功能激活时间 //if(func.activeFrameBegin<0||frameindex<func.activeFrameBegin)return false; //if(func.activeFrameEnd>=0&&frameindex>func.activeFrameEnd)return false; if (func.intParam1 == 1 && !fight.IsHit()) //是否攻击中 { // Debug.Log("false"); return(false); } if (fight.TestCmd(func.strParam0, func.vecParam0.x)) { fight.ChangeBlock(func.strParam1, func.intParam0); /* Debug.Log("WantChangeBlock:" + func.strParam1 + "(" + func.intParam0 + ")");*/ return(true); } return(false); }
static void SelectSelectFunc(FB.FFSM.BlockFunc func) { selectFunc = func; if (regfuncs == null || selectFunc == null) { return; } string classname = selectFunc.classname; if (!string.IsNullOrEmpty(classname)) { if (regfuncs.ContainsKey(classname)) { var func2 = regfuncs[classname]; if (func2 != null) { func2.Init(); } } } }
public void OnGUI(FB.FFSM.BlockFunc func) { //int0 dark screen //int1 焦点(镜头放大跟踪) //int2 暂停世界(除了我) //int3 摇晃摄像机 EditorGUILayout.HelpBox("这个功能是触发世界级效果", MessageType.Info); { int b = EditorGUILayout.Toggle("dark screen", func.intParam0 > 0) ? 1 : 0; if (b != func.intParam0) { func.intParam0 = b; EditorUtility.SetDirty(Window_StateTable.stateTable); } } { int b = EditorGUILayout.Toggle("焦点(镜头放大跟踪)", func.intParam1 > 0) ? 1 : 0; if (b != func.intParam1) { func.intParam1 = b; EditorUtility.SetDirty(Window_StateTable.stateTable); } } { int b = EditorGUILayout.Toggle("暂停世界(除了我)", func.intParam2 > 0) ? 1 : 0; if (b != func.intParam2) { func.intParam2 = b; EditorUtility.SetDirty(Window_StateTable.stateTable); } } { int b = EditorGUILayout.Toggle("摇晃摄像机", func.intParam3 > 0) ? 1 : 0; if (b != func.intParam3) { func.intParam3 = b; EditorUtility.SetDirty(Window_StateTable.stateTable); } } }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { //if (func.activeFrameBegin < 0 || frameindex < func.activeFrameBegin) return false; //if (func.activeFrameEnd >= 0 && frameindex > func.activeFrameEnd) return false; if (func.intParam0 == 1) { fight.SetForceClear(); } if (func.intParam1 == 1) { var dir = FBJoy2.g_joy.curState.dir; fight.AddForceSpeedWithoutCharDir(new Vector3(func.vecParam0.x * dir.x, 0, func.vecParam0.z * dir.y)); } else { fight.AddForceSpeed(func.vecParam0); /* Debug.Log("Force:" + func.vecParam0);*/ } return(false); }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { if (func.intParam3 == 1 && !fight.IsHit()) //是否攻击中 { // Debug.Log("false"); return(false); } bool active = false; int v = fight.GetProp(func.strParam0); int tv = func.intParam1; PropOp op = (PropOp)func.intParam2; if (op == PropOp.Add) { v += tv; fight.SetProp(func.strParam0, v); active = true; } else if (op == PropOp.Set) { v = tv; fight.SetProp(func.strParam0, v); active = true; } else if (op == PropOp.Eat && v >= tv) { v -= tv; fight.SetProp(func.strParam0, v); active = true; } if (active && !string.IsNullOrEmpty(func.strParam1)) { fight.ChangeBlock(func.strParam1, func.intParam0); return(true); } return(false); }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { bool active = false; int v = fight.GetProp(func.strParam0); int tv = func.intParam1; WhenExit when = (WhenExit)func.intParam2; if (when == WhenExit.Equal && v == tv) { active = true; } else if (when == WhenExit.Great && v > tv) { active = true; } else if (when == WhenExit.GreatEqual && v >= tv) { active = true; } else if (when == WhenExit.Less && v < tv) { active = true; } else if (when == WhenExit.LessEqual && v <= tv) { active = true; } else if (when == WhenExit.NotEqual && v != tv) { active = true; } if (active) { fight.ChangeBlock(func.strParam1, func.intParam0); return(true); } return(false); }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是松开被抓持的目标", MessageType.Info); }
public void OnGUI(FB.FFSM.BlockFunc func) { GUILayout.Label("Test custom UI"); }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { fight.CreateFlyItem(func.intParam0, func.intParam1, func.strParam0, func.vecParam0); return(false); }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { fight.SetBreakLevel(func.intParam0); return(false); }
public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { //增加抓握,和跟踪点 fight.FE_AddHit(func.intParam0, func.intParam1, func.strParam0, func.intParam2, func.strParam1, func.intParam3 > 0, func.intParam4 > 0); return(false); }
//public bool Init(IFightFSM fight, BlockFunc func) //{ // fight.Turn(); // return false; //} public bool Update(IFightFSM fight, BlockFunc func, int frameindex) { fight.Turn(); return(false); }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是配置PropExit", MessageType.Info); FB.FFSM.BlockParser_WhenPropExit.WhenExit opera = (FB.FFSM.BlockParser_WhenPropExit.WhenExit)func.intParam2; EditorGUILayout.BeginHorizontal(); /* GUILayout.Label("类型:", GUILayout.Width(30));*/ //str0 func.strParam0 = EditorGUILayout.TextField(func.strParam0, GUILayout.Width(50)); var exit2 = (FB.FFSM.BlockParser_WhenPropExit.WhenExit)EditorGUILayout.EnumPopup(opera, GUILayout.Width(200)); //int2 func.intParam2 = (int)exit2; /* GUILayout.Label("数值:", GUILayout.Width(30));*/ func.intParam1 = EditorGUILayout.IntField(func.intParam1, GUILayout.Width(50)); EditorGUILayout.EndHorizontal(); //stand GUILayout.BeginHorizontal(); GUILayout.Label("状态:", GUILayout.Width(50)); string butt_str = "选择"; if (!string.IsNullOrEmpty(func.strParam1) && func.strParam1 != "") { butt_str = func.strParam1; } List <string> allstatename = new List <string>(); foreach (var state in Window_StateTable.stateTable.allStates) { allstatename.Add(state.name); } if (GUILayout.Button(butt_str, GUILayout.Width(butt_str.Length * 7 + 15))) { Window_PickState.Show(Window_StateTable.StateTree.states, (str) => { pickstr_exitstate = str; }, true); } if (!string.IsNullOrEmpty(pickstr_exitstate) && pickstr_exitstate != func.strParam1) { //str1 func.strParam1 = pickstr_exitstate; pickstr_exitstate = null; func.intParam0 = -1; } GUILayout.EndHorizontal(); //index GUILayout.BeginHorizontal(); GUILayout.Label("index:", GUILayout.Width(50)); string idex_str = "选择"; if (!string.IsNullOrEmpty(func.strParam1) && func.strParam1 != "" && func.intParam0 >= 0) { idex_str = func.intParam0.ToString(); } var select_state = Window_StateTable.stateTable.allStates.Find(s => s.name == func.strParam1); List <string> allblockname = new List <string>(); int count = 0; if (select_state != null) { foreach (var block in select_state.blocks) { allblockname.Add(count.ToString()); count++; } } if (GUILayout.Button(idex_str, GUILayout.Width(120))) { Window_PickAny.ShowAny(allblockname, (str) => { pickstr_exitint = str; //this.Focus(); //Repaint(); }); } if (!string.IsNullOrEmpty(pickstr_exitint)) { //int0 int.TryParse(pickstr_exitint, out func.intParam0); pickstr_exitint = null; } //int id = EditorGUILayout.IntField(_selectBlock.exits[ie].blockindex, GUILayout.Width(120)); GUILayout.EndHorizontal(); }
public void OnGUI(FB.FFSM.BlockFunc func) { EditorGUILayout.HelpBox("这个功能是配置func_breaklevel", MessageType.Info); func.intParam0 = EditorGUILayout.IntField("中断等级", func.intParam0); }