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 不支持过渡条件的更多相关文章

  1. Playmaker全面实践教程之playMaker编辑器

    Playmaker全面实践教程之playMaker编辑器 playMaker编辑器 playMaker编辑器是制作状态机的主要视图,如图1-23所示.只有熟悉此视图,读者才能更加快捷的使用Playma ...

  2. PlayMaker入门介绍

    http://www.jianshu.com/p/ce791bef66bb   PlayMaker是什么? PlayMaker是Unity3D的一款 可视化 的 有限元状态机(Finite-state ...

  3. 支持 .NET Core 的 Memcached 客户端 EnyimMemcachedCore

    1. 介绍 EnyimMemcachedCore 是一个支持 .NET Core 的 Memcached 客户端,是从 EnyimMemcached 迁移至 .NET Core的,源代码托管在 Git ...

  4. ASP.NET Core 折腾笔记二:自己写个完整的Cache缓存类来支持.NET Core

    背景: 1:.NET Core 已经没System.Web,也木有了HttpRuntime.Cache,因此,该空间下Cache也木有了. 2:.NET Core 有新的Memory Cache提供, ...

  5. Jexus 5.8.2 正式发布为Asp.Net Core进入生产环境提供平台支持

    Jexus 是一款运行于 Linux 平台,以支持  ASP.NET.PHP 为特色的集高安全性和高性能为一体的 WEB 服务器和反向代理服务器.最新版 5.8.2 已经发布,有如下更新: 1,现在大 ...

  6. 7.让网站支持http和https的访问方式

    平台之大势何人能挡? 带着你的Net飞奔吧!:http://www.cnblogs.com/dunitian/p/4822808.html#iis 怎么让网站在本地支持SSL?http://www.c ...

  7. 逆天通用水印支持Winform,WPF,Web,WP,Win10。支持位置选择(9个位置 ==》[X])

    常用技能:http://www.cnblogs.com/dunitian/p/4822808.html#skill 逆天博客:http://dnt.dkil.net 逆天通用水印扩展篇~新增剪贴板系列 ...

  8. x:bind不支持样式文件 或 此Xaml文件必须又代码隐藏类才能使用{x:Bind} 解决办法

    这两天学习UWP开发,发现一个很有趣的问题,就是我题目中的描述的. 我习惯了在ResourceDictionary中写样式文件,但是发现用x:Bind时会有问题 如果是写在Style里,则提示 “x: ...

  9. .NET Core采用的全新配置系统[9]: 为什么针对XML的支持不够好?如何改进?

    物理文件是我们最常用到的原始配置的载体,最佳的配置文件格式主要由三种,它们分别是JSON.XML和INI,对应的配置源类型分别是JsonConfigurationSource.XmlConfigura ...

随机推荐

  1. Flask实战第44天:完成前台注册功能

    注册功能后端逻辑 用户注册要把注册的表单提交上来,因此,我要先对表单进行验证,编辑front.forms from apps.forms import BaseForm from wtforms im ...

  2. Python lambda介绍(转)

    在学习python的过程中,lambda的语法时常会使人感到困惑,lambda是什么,为什么要使用lambda,是不是必须使用lambda? 下面就上面的问题进行一下解答. 1.lambda是什么? ...

  3. 「NOI2018」归程

    「NOI2018」归程 题目描述 本题的故事发生在魔力之都,在这里我们将为你介绍一些必要的设定. 魔力之都可以抽象成一个 >\(1\) 个节点. \(m\) 条边的无向连通图(节点的编号从 \( ...

  4. [BZOJ3622]已经没有什么好害怕的了(容斥DP)

    给定两个数组a[n]与b[n](数全不相等),两两配对,求“a比b大”的数对比“b比a大”的数对个数多k的配对方案数. 据说做了这题就没什么题好害怕的了,但感觉实际上这是一个套路题,只是很难想到. 首 ...

  5. 雅礼集训DAY 6 T1 xmasdag

    感谢gryz的mly大好人再次给我提供了题目和数据. 和昨晚那个题几乎一样,都是x^n最后转化成第二类斯特林数*阶乘*Σ(和路径长度有关的组合数),而因为组合数是可以利用Pascal公式实现O(1)递 ...

  6. [TCO2009]NumberGraph

    题意:给你一些带权的节点和一个正整数集合$S$,$S$中每一个数的二进制后缀$0$个数相同,节点$x$的权值为$v_x$,如果对于$x,y$存在$t\in S$使得$|v_x-v_y|=t$,那么连边 ...

  7. 【二分】【半平面交】Gym - 101309J - Jungle Outpost

    发现炸毁的瞭望塔必然是连续的,其余下的部分是一个半平面. 二分答案,枚举所有可能的炸毁情况,做个半平面交,如果交出来面积是0,就可以保证不存在安全区域. #include<cstdio> ...

  8. 【带权并查集】Gym - 100923H - Por Costel and the Match

    裸题. 看之前的模版讲解吧,这里不再赘述了. #include<cstdio> #include<cstring> using namespace std; int fa[10 ...

  9. [bzoj1011](HNOI2008)遥远的行星(近似运算)

    Description 直 线上N颗行星,X=i处有行星i,行星J受到行星I的作用力,当且仅当i<=AJ.此时J受到作用力的大小为 Fi->j=Mi*Mj/(j-i) 其中A为很小的常量, ...

  10. 十一. 图形、图像与多媒体4.Graphics类的绘图方法

    Graphics类提供基本绘图方法,Graphics2D类提供更强大的绘图能力.本节讲解Graphics类,下节讲解Graphics2D. Graphics类提供基本的几何图形绘制方法,主要有:画线段 ...