-
Notifications
You must be signed in to change notification settings - Fork 0
/
natCorderGetThumb.cs
58 lines (46 loc) · 1.06 KB
/
natCorderGetThumb.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Custom Action by DumbGameDev
// www.dumbgamedev.com
using UnityEngine;
using NatCorderU;
using NatCorderU.Core;
using NatCorderU.Extensions;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Nat Corder")]
[Tooltip("Get Nat Corder recording thumbnail.")]
public class natCorderGetThumb : FsmStateAction
{
[RequiredField]
[Tooltip("The recording path.")]
[UIHint(UIHint.Variable)]
public FsmString recordingPath;
[RequiredField]
[Tooltip("Thumbnail object.")]
[UIHint(UIHint.Variable)]
public FsmTexture thumbnail;
private string path;
private Texture2D texture2d;
private Texture texture;
public override void Reset()
{
recordingPath = null;
path = null;
}
public override void OnEnter()
{
doShare();
Finish();
}
void doShare()
{
path = recordingPath.Value;
if(path == null)
{
return;
}
texture2d = Sharing.GetThumbnail(path);
texture = texture2d;
thumbnail.Value = texture;
}
}
}