can be useful... for something
using UnityEngine;
using HutongGames.PlayMaker;
[ActionCategory("Texture")]
[Tooltip("Get the size in pixel of a texture")]
public class GetTextureSize : FsmStateAction
{
[RequiredField]
public FsmTexture targetTexture;
public FsmInt storedWidth;
public FsmInt storedHeight;
public override void Reset ()
{
targetTexture = null;
storedWidth = null;
storedHeight = null;
}
public override void OnEnter ()
{
DoGetTextureSize();
Finish();
}
void DoGetTextureSize()
{
if(targetTexture.IsNone)
return;
storedWidth.Value = targetTexture.Value.width;
storedHeight.Value = targetTexture.Value.height;
}
}