summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/AI/AIRunTimeGetRealtimeSinceStartup.cs
blob: 5278a761cfcfb85f0ea857fdd13eda1c121b7b5a (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
using System;
using System.Xml;
using UnityEngine;

namespace XMainClient
{
	internal class AIRunTimeGetRealtimeSinceStartup : AIRunTimeNodeAction
	{
		private string _store_res_name;

		private float _store_res;

		public AIRunTimeGetRealtimeSinceStartup(XmlElement node) : base(node)
		{
			this._store_res_name = node.GetAttribute("Shared_FloatstoreResultName");
		}

		public override bool Update(XEntity entity)
		{
			this._store_res = Time.realtimeSinceStartup;
			entity.AI.AIData.SetFloatByName(this._store_res_name, this._store_res);
			return true;
		}
	}
}