playMaker

Author Topic: 2d toolkit scale sprite  (Read 2653 times)

msc4tech

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
    • http://www.msc4tech.com
2d toolkit scale sprite
« on: December 06, 2011, 03:17:34 AM »
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
   [ActionCategory("2D Toolkit")]
   [Tooltip("scale sprite  of tk2dSprite")]
   public class Scale2dToolkitSprite : FsmStateAction {
      [RequiredField]
      public FsmOwnerDefault gameObject;      
      [RequiredField]
      public FsmVector3 scalo;
      
      private GameObject go;
      private tk2dSprite sprite;
      
      public override void Reset() {
         gameObject = null;
         scalo = null;
      }
      
      public override void OnEnter() {
         go = gameObject.OwnerOption == OwnerDefaultOption.UseOwner ? Owner : gameObject.GameObject.Value;
         sprite = go.GetComponent<tk2dSprite>();
         sprite.scale=scalo.Value;
         Finish();
      }
   }
}

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14593
  • Official Playmaker Support
    • View Profile
Re: 2d toolkit scale sprite
« Reply #1 on: January 13, 2012, 01:08:49 AM »
Hi Everyone,

 I have started porting 2d toolkit and currently gathering custom actions. The package will be available very soon :)

 Meanwhile, if you have wishes or requests for 2d toolkit and playmaker, this is the right time to ask for it :)

 Thanks for ms4Tech for the head start on them actions.

https://hutonggames.fogbugz.com/default.asp?W717

 Bye,

 Jean