playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - rocket5

Pages: [1]
1
PlayMaker Bug Reporting / All my FSM's lost connection to PlayMakerFSM
« on: August 30, 2011, 06:49:44 PM »
Some other script put Unity in an infinite loop so I had to Force Quit Unity (running on OSX).  When I opened up my project again, all of the objects with FSM's in my scene had lost the reference to PlayMakerFSM.  I was able to reassign the missing PlayMakerFSM on the FSM's which fixed the problem. 

Luckily I only have about a dozzen FSM's in my project so far since I just started using playMaker, but if this had been a huge project (which it will be very soon), this would have been a major disaster. 

How can I ever trust playMaker to not do this again?  I'm not sure that I can...

2
Share New Actions / 2D Toolkit Play() Animation
« on: August 28, 2011, 05:43:21 PM »
Here's an Action that will play an animation on a 2D Toolkit Animated Sprite (tk2dAnimatedSprite).  This is my first Action so I don't know yet if there's a better way to do this, but it works!  -Tim

Code: [Select]
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("2D Toolkit")]
[Tooltip("Plays a sprite animation on a tk2dAnimatedSprite")]
public class PlayAnim : FsmStateAction {
[RequiredField]
public FsmOwnerDefault gameObject;
public FsmString clipName;

private GameObject go;
private tk2dAnimatedSprite spriteAnim;

public override void Reset() {
gameObject = null;
clipName = null;
}

public override void OnEnter() {
go = gameObject.OwnerOption == OwnerDefaultOption.UseOwner ? Owner : gameObject.GameObject.Value;
spriteAnim = go.GetComponent<tk2dAnimatedSprite>();
spriteAnim.Play(clipName.Value);
Finish();
}
}
}

Pages: [1]