File size: 956 Bytes
ce81a16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
using System;
using System.Collections.Generic;
using Photon.Deterministic;

namespace Quantum
{
	public partial class HFSMRoot : AssetObject
	{
		public string Label;

		public AssetRefHFSMState[] StatesLinks;

		public AssetRefHFSMState InitialState
		{
			get
			{
				if (StatesLinks != null)
				{
					return StatesLinks[0];
				}
				return default;
			}
		}

		public string[] EventsNames;

		[NonSerialized]
		public Dictionary<string, int> RegisteredEvents = new Dictionary<string, int>();

		public override void Loaded(IResourceManager resourceManager, Native.Allocator allocator)
		{
			base.Loaded(resourceManager, allocator);

			RegisteredEvents.Clear();
			for (int i = 0; i < EventsNames.Length; i++)
			{
				RegisteredEvents.Add(EventsNames[i], i + 1);
			}
		}

		public string GetEventName(int eventID)
		{
			foreach (var kvp in RegisteredEvents)
			{
				if (kvp.Value == eventID)
					return kvp.Key;
			}
			return "";
		}
	}
}