summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Decompile/I2.Loc/LocalizeTarget.cs
blob: a746e60f87a48107195725b5b97f3933fa488620 (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 UnityEngine;

namespace I2.Loc;

public abstract class LocalizeTarget<T> : ILocalizeTarget where T : Object
{
	public T mTarget;

	public override bool IsValid(Localize cmp)
	{
		if ((Object)mTarget != (Object)null)
		{
			Component component = mTarget as Component;
			if (component != null && component.gameObject != cmp.gameObject)
			{
				mTarget = null;
			}
		}
		if ((Object)mTarget == (Object)null)
		{
			mTarget = cmp.GetComponent<T>();
		}
		return (Object)mTarget != (Object)null;
	}
}