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. Oracle REGEXP

    ORACLE中的支持正则表达式的函数主要有下面四个: 1,REGEXP_LIKE :与LIKE的功能相似 2,REGEXP_INSTR :与INSTR的功能相似 3,REGEXP_SUBSTR :与S ...

  2. BZOJ 2809 [Apio2012]dispatching(斜堆+树形DP)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=2809 [题目大意] 给出一棵树,求出每个点有个权值,和一个乘算值,请选取一棵子树, 并 ...

  3. [TC14860]SquadConstructor2

    [TC14860]SquadConstructor2 题目大意: 有\(n(n<2^m,m\le8)\)个互不相等的数\(v_i\).从中选取\(k(k\le8)\)个数\(b_i\),求\(\ ...

  4. JDK源码学习笔记——Integer

    一.类定义 public final class Integer extends Number implements Comparable<Integer> 二.属性 private fi ...

  5. 1.3 (JavaScript学习笔记)JavaScript对象

    在JavaScript中所有事物都是对象,字符串.数值.数组.函数...等, JavaScript还允许自定义对象.这些在1.1中有所介绍. 一.遍历对象属性 <!DOCTYPE html> ...

  6. [HTML/CSS]说说position

    目录 语法 作用 使用定位的条件 总结 语法 position : static absolute relative(static.absolute.relative常用值). 参数 static : ...

  7. Ubuntu下,清屏等终端常用命令

    转自:http://blog.csdn.net/gaojinshan/article/details/9314435 # ctrl + l - 清屏 . cLear# ctrl + c - 终止命令. ...

  8. MySQL建表时,日期时间类型选择

    MySQL(5.5)所支持的日期时间类型有:DATETIME. TIMESTAMP.DATE.TIME.YEAR. 几种类型比较如下: 日期时间类型 占用空间 日期格式 最小值 最大值 零值表示  D ...

  9. es服务

    #!/bin/bash #chkconfig:2345 20 90 #description: elastic service #processname: elastic ROOT_PATH=/es5 ...

  10. Documentation/ABI/testing/sysfs-block.txt

    Chinese translated version of Documentation/ABI/testing/sysfs-block.txt If you have any comment or u ...