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 ...
随机推荐
- linux——(1)初识linux
linux有窗口管理员环境和纯文本界面环境,同时linux默认提供6个Terminal来让用户登录.crtl+alt+F1-6可自由切换.其中如果窗口管理员环境处于运行状态,那么可以按crtl+alt ...
- js中的property和attribute
javascript中的property和attribute虽然都被翻译为“属性”,但是他们还是有区别的. 前两天写网页时用到checkbox,就被property和attribute弄晕了好久.后来 ...
- 2016ACM-ICPC网络赛北京赛区 1001 (trie树牌大模拟)
[题目传送门] 1383 : The Book List 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 The history of Peking University ...
- 【最短路】【spfa】CDOJ1633 去年春恨却来时,落花人独立,微雨燕双飞
对于S集合中的数,例如a1,考虑到如果x能够被表示出来,那么x+a1也一定能被表示出来 设d[r]为所有模a1余r的数中,能被表示出来的最小的数 用d[x]+ai去更新d[(x+ai)%a1],跑最短 ...
- 企鹅----sap+裂点
企鹅 题目描述 在靠近南极的某处,一些企鹅站在许多漂浮的冰块上.由于企鹅是群居动物,所以它们想要聚集到一起,在同一个冰块上.企鹅们不想把自己的身体弄湿,所以它们在冰块之间跳跃,但是它们的跳跃距离,有一 ...
- MYSQL复习笔记1-物理文件和系统架构
date:20140101auth:Jin 一.物理组成(一) 日志文件参考:http://dev.mysql.com/doc/refman/5.1/en/server-logs.html1.错误日志 ...
- HDU 4576 Robot (很水的概率题)
Robot Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total Sub ...
- NHibernate 之数据操作 (第五篇)
数据操作,在这里主要介绍INSERT.UPDATE.DELETE.我们在使用NHibernate的时候,如果只是查询数据,不需要改变数据库的值,那么是不需要提交或者回滚到数据库的. 一.INSERT ...
- C\C++宏大全
一.标准预定义宏The standard predefined macros are specified by the relevant language standards, so they are ...
- PostgreSQL配置文件--实时统计
7 实时统计 RUNTIME STATISTICS 7.1 Query/Index Statistics Collector 下面的参数控制是否搜集特定的数据库运行统计数据 7.1.1 track_a ...