Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        public void Init()
        {
            if (FindByTag && Pawn == null)
            {
                var go = GameObject.FindGameObjectWithTag(PawnTag);
                Pawn = go ? go.GetComponentInChildren <BasePawn>() : null;
            }

            if (Pawn != null)
            {
                Pawn.Init();
            }

            OnInit();
        }