PlayMaker 不支持过渡条件
Unity Animator 自带也支持过渡条件, 我看了下PlayMaker没有这个概念. 最近研究下PlayMaker,图形化编程的确很爽. 但是PlayMaker 始于与给一些策划进行流程设置. 用它来全程做游戏我感觉会疯的.


在Playmaker上自己封装的条件类
using HutongGames.PlayMaker;
using System.Collections;
using System.Collections.Generic;
using UnityEngine; public class CondFloat : BaseCond
{
[UIHint(UIHint.FsmFloat)]
public FsmFloat mVal1;
public ECondition mCondition;
[UIHint(UIHint.FsmFloat)]
public FsmFloat mVal2; public override bool Condition()
{
if (mCondition == ECondition.Equal)
return mVal1.Value == mVal2.Value;
if (mCondition == ECondition.Less)
return mVal1.Value < mVal2.Value;
if (mCondition == ECondition.Greater)
return mVal1.Value > mVal2.Value; return false;
}
} public class CondBool : BaseCond
{
[UIHint(UIHint.FsmBool)]
public FsmBool mVal1;
public override bool Condition()
{
return mVal1.Value;
}
} public class CondString : BaseCond
{
[UIHint(UIHint.FsmString)]
public FsmString mVal1;
[UIHint(UIHint.FsmString)]
public FsmString mVal2; public override bool Condition()
{
return mVal1.Equals(mVal2);
}
} public class CondMethod : BaseCond
{
[UIHint(UIHint.Method)]
public FsmString mVal1;
[UIHint(UIHint.Method)]
public FsmString mVal2; public override bool Condition()
{
return mVal1.Equals(mVal2);
}
}
[SerializeField]
public class BaseCond
{
public string mEventName; public string GetEventName()
{
return mEventName;
} public virtual bool Condition()
{
return false;
} }
public enum ECondition
{
Less,
Equal,
Greater
}
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using System.Collections;
using System.Collections.Generic;
using UnityEngine; [ActionCategory(ActionCategory.Debug)]
[HutongGames.PlayMaker.Tooltip("发送事件")]
public class SendMethod : FsmStateAction
{
public string mMethodName; public override void OnEnter()
{
this.Finish();
}
}
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using System.Collections;
using System.Collections.Generic;
using UnityEngine; public abstract class CondAction : SendMethod
{
public abstract BaseCond Condition { get;} public override void OnEnter()
{
bool l = Condition.Condition();
string s = Condition.GetEventName(); if (l)
{
this.Fsm.Event(s);
Debug.Log("发送事件");
}
this.Finish();
}
}
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System; public class CondActionBool : CondAction
{
public CondBool mCondition; public override BaseCond Condition
{
get
{
return mCondition;
}
} }
代码浏览

代码地址: https://gitee.com/PFSchool/UFrame.git ScriptTools文件夹下
PlayMaker 不支持过渡条件的更多相关文章
- Playmaker全面实践教程之playMaker编辑器
Playmaker全面实践教程之playMaker编辑器 playMaker编辑器 playMaker编辑器是制作状态机的主要视图,如图1-23所示.只有熟悉此视图,读者才能更加快捷的使用Playma ...
- PlayMaker入门介绍
http://www.jianshu.com/p/ce791bef66bb PlayMaker是什么? PlayMaker是Unity3D的一款 可视化 的 有限元状态机(Finite-state ...
- 支持 .NET Core 的 Memcached 客户端 EnyimMemcachedCore
1. 介绍 EnyimMemcachedCore 是一个支持 .NET Core 的 Memcached 客户端,是从 EnyimMemcached 迁移至 .NET Core的,源代码托管在 Git ...
- ASP.NET Core 折腾笔记二:自己写个完整的Cache缓存类来支持.NET Core
背景: 1:.NET Core 已经没System.Web,也木有了HttpRuntime.Cache,因此,该空间下Cache也木有了. 2:.NET Core 有新的Memory Cache提供, ...
- Jexus 5.8.2 正式发布为Asp.Net Core进入生产环境提供平台支持
Jexus 是一款运行于 Linux 平台,以支持 ASP.NET.PHP 为特色的集高安全性和高性能为一体的 WEB 服务器和反向代理服务器.最新版 5.8.2 已经发布,有如下更新: 1,现在大 ...
- 7.让网站支持http和https的访问方式
平台之大势何人能挡? 带着你的Net飞奔吧!:http://www.cnblogs.com/dunitian/p/4822808.html#iis 怎么让网站在本地支持SSL?http://www.c ...
- 逆天通用水印支持Winform,WPF,Web,WP,Win10。支持位置选择(9个位置 ==》[X])
常用技能:http://www.cnblogs.com/dunitian/p/4822808.html#skill 逆天博客:http://dnt.dkil.net 逆天通用水印扩展篇~新增剪贴板系列 ...
- x:bind不支持样式文件 或 此Xaml文件必须又代码隐藏类才能使用{x:Bind} 解决办法
这两天学习UWP开发,发现一个很有趣的问题,就是我题目中的描述的. 我习惯了在ResourceDictionary中写样式文件,但是发现用x:Bind时会有问题 如果是写在Style里,则提示 “x: ...
- .NET Core采用的全新配置系统[9]: 为什么针对XML的支持不够好?如何改进?
物理文件是我们最常用到的原始配置的载体,最佳的配置文件格式主要由三种,它们分别是JSON.XML和INI,对应的配置源类型分别是JsonConfigurationSource.XmlConfigura ...
随机推荐
- JZYZOJ1530 [haoi2013]开关控制 状压 dfs 折半搜索
http://172.20.6.3/Problem_Show.asp?id=1530 元宵节快要到了,某城市人民公园将举办一次灯展.Dr.Kong准备设计出一个奇妙的展品,他计划将编号为1到N的N(1 ...
- JZYZOJ1355 [usaco2007]奶牛赛跑 矩阵乘法 离散化
http://172.20.6.3/Problem_Show.asp?id=1355 写的时候本来想离散化,“1000^2的数组放一两个到函数里而已嘛,指定承受得住”,然后没离散化,然后就爆栈了, ...
- “过时”的SpringMVC我们到底在用什么?深入分析DispatchServlet源码
之前已经分析过了Spring的IOC(<零基础带你看Spring源码--IOC控制反转>)与AOP(<从源码入手,一文带你读懂Spring AOP面向切面编程>)的源码,本次就 ...
- java中interface的完整表述
我用一个工具:java Decompiler反编译工具查看jar包源码的时候,出现了以下代码: public abstract interface AbsITest{} 在网上搜索了一下: 我对这种情 ...
- Wunder Fund Round 2016 (Div. 1 + Div. 2 combined) E. Robot Arm 线段树
E. Robot Arm 题目连接: http://www.codeforces.com/contest/618/problem/E Description Roger is a robot. He ...
- (Mark=转)ehcache memcache redis
Ehcache 在java项目广泛的使用.它是一个开源的.设计于提高在数据从RDBMS中取出来的高花费.高延迟采取的一种缓存方案.正因为Ehcache具有健壮性(基于java开发).被认证(具有apa ...
- BaseLoadDataForNetFragment
/** * Fragment 加载网络请求 */ public abstract class BaseLoadDataForNetFragment extends Fragment { // 视图是否 ...
- Android——多线程之Handler
Why? 因为在Android系统中UI操作并不是线程安全的,如果多个线程并发的去操作同一个组件,可能导致线程安全问题.为了解决这一个问题, android制定了一条规则:只允许UI线程来修改UI组件 ...
- [译]SQL数据库迁移:从低版到高版本
我见过太多的数据库管理员花大量的时间在数据库迁移上,即便在客户的实际环境亦是如此.由于微软频繁的发布新版,基于业务和客户的要求,应用服务不得不同时升级.当然,还有许多用户仍在使用SQL Server ...
- 【JSP EL】<c:if> <c:foreach >EL表达式 获取list长度/不用循环,EL在List中直接获取第一项的内容/EL获取Map的键,Map的值
1.EL表达式 获取list长度 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" ...