Exemple #1
0
        private void Init()
        {
            if (_target == null)
            {
                _target = (UtilityAIComponent)this.target;
            }

            var currentSelectedAIs = _target.aiConfigs;

            if (currentSelectedAIs == null)
            {
                return;
            }

            _aiNames = new string[currentSelectedAIs.Length];

            for (int i = 0; i < currentSelectedAIs.Length; i++)
            {
                var ai = currentSelectedAIs[i] != null?StoredAIs.GetById(currentSelectedAIs[i].aiId) : null;

                if (ai != null)
                {
                    _aiNames[i] = ai.name;
                }
                else
                {
                    _aiNames[i] = "?";
                }
            }
        }
Exemple #2
0
 static AIManager()
 {
     AIManager.initLock    = new object();
     AIManager.GetAIClient = (GameObject host, Guid aiId) => {
         UtilityAIComponent component = host.GetComponent <UtilityAIComponent>();
         if (component == null)
         {
             return(null);
         }
         return(component.GetClient(aiId));
     };
 }