summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/geraint_get_wings.cs
blob: 853017b0f24304dc57a865468b6fa31e335d1674 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Collections.Generic;
using UnityEngine;
using XUtliPoolLib;

namespace XMainClient
{
	internal class geraint_get_wings
	{
		private static bool _once = false;

		private static CommandCallback _activeWingCb = new CommandCallback(geraint_get_wings._ActiveWing);

		private static void _ActiveWing(XGameObject gameObject, object o, int commandID)
		{
			Transform transform = gameObject.Find("Object001_wing");
			bool flag = transform != null;
			if (flag)
			{
				bool flag2 = !transform.gameObject.activeSelf;
				if (flag2)
				{
					transform.gameObject.SetActive(true);
				}
			}
		}

		public static bool Do(List<XActor> actors)
		{
			bool flag = actors == null;
			bool result;
			if (flag)
			{
				geraint_get_wings._once = false;
				result = true;
			}
			else
			{
				bool once = geraint_get_wings._once;
				if (once)
				{
					result = false;
				}
				else
				{
					geraint_get_wings._once = true;
					List<XEntity> ally = XSingleton<XEntityMgr>.singleton.GetAlly(XSingleton<XEntityMgr>.singleton.Player);
					for (int i = 0; i < ally.Count; i++)
					{
						XEntity xentity = ally[i];
						bool flag2 = xentity.Attributes.TypeID == 3002u;
						if (flag2)
						{
							bool flag3 = xentity.EngineObject != null;
							if (flag3)
							{
								xentity.EngineObject.CallCommand(geraint_get_wings._activeWingCb, null, -1, false);
							}
						}
					}
					bool flag4 = actors[0].EngineObject != null;
					if (flag4)
					{
						actors[0].EngineObject.CallCommand(geraint_get_wings._activeWingCb, null, -1, false);
					}
					result = true;
				}
			}
			return result;
		}
	}
}