public void Init() { if (FindPawnByTag && Pawn == null) { var go = GameObject.FindGameObjectWithTag(PawnTag); Pawn = go ? go.GetComponentInChildren <BasePawn>() : null; } if (Pawn != null) { Pawn.Init(); } System = FindSystem(); if (System) { if (!_cachedSystem) { _cachedSystem = System; } System.Register(this); OnInit(); } else { Debug.LogError("Unable to initialize controller - system not found!", this); } }
public void Init() { if (FindByTag && Pawn == null) { var go = GameObject.FindGameObjectWithTag(PawnTag); Pawn = go ? go.GetComponentInChildren <BasePawn>() : null; } if (Pawn != null) { Pawn.Init(); } OnInit(); }