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 ...
随机推荐
- 【数据结构】 最小生成树(三)——prim算法
上一期介绍到了kruskal算法,这个算法诞生于1956年,重难点就是如何判断是否形成回路,此处要用到并查集,不会用当然会觉得难,今天介绍的prim算法在kruskal算法之后一年(即1957年)诞生 ...
- Check if a user is in a group
groups or groups user
- Xamarin Android项目提示SDK版本太老
Xamarin Android项目提示SDK版本太老 错误信息:The installed Android SDK is too old.Version 24.3.4 or newer is requ ...
- python队列、线程、进程、协程(转)
原文地址: http://www.cnblogs.com/wangqiaomei/p/5682669.html 一.queue 二.线程 #基本使用 #线程锁 #自定义线程池 #生产者消费者模型(队列 ...
- 【SPFA】POJ3259-Wormhole
普通的SPFA的负环判定.犯了三个错误,全部写在注释里了. #include<iostream> #include<cstdio> #include<cstring> ...
- TZOJ 数据结构实验--循环队列
描述 创建一个循环队列,队列元素个数为4.能够实现队列的初始化.入队列.出队列.求队列长度等操作. 循环队列数据类型定义如下: typedef struct{ int data[Max]; in ...
- Problem G: 零起点学算法102——删除字符
#include<stdio.h> #include<string.h> int main() { ],a; while(gets(ch)!=NULL) { scanf(&qu ...
- 控制台+Owin搭建WebAPI接口服务
当没有iis环境.想快速启动几个api接口测试又觉得新建一个api项目麻烦?来使用控制台做宿主,快速改几个api测试吧! 1.新建控制台项目 2.安装以下相关依赖 Microsoft.AspNet.W ...
- Bower管理依赖库初体验
比如一开始我用了jquery-1.10.2.min.js,后来要用bootstrap,但bootstrap依赖的确实2.0.3版本的jquery,那又要下载一个去替换原来的,这样的事情发生多了就会觉得 ...
- webService 三要素
WebService(jax-ws)三要素 SOAP: 基于HTTP协议,采用XML格式,用来传递信息的格式. WSDL: 用来描述如何访问具体的服务.(相当于说明书) UDDI: 用户自己可以按UD ...