コード例 #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] = "?";
                }
            }
        }
コード例 #2
0
ファイル: AIUI.cs プロジェクト: xwf20050250/Apex-Game-Tools
        internal static AIUI Load(string aiId, bool refreshState)
        {
            var data = StoredAIs.GetById(aiId);

            if (data == null)
            {
                EditorUtility.DisplayDialog("Load Failed.", "The requested AI can no longer be found.", "Ok");
                return(null);
            }

            return(Load(data, refreshState));
        }
コード例 #3
0
        private void OnEnable()
        {
            _props = this.GetProperties("relevantAIId", "mode");

            _target = this.target as ContextVisualizerComponent;
            if (string.IsNullOrEmpty(_target.relevantAIId))
            {
                _relevantAiName = "All";
                return;
            }

            var ai = StoredAIs.GetById(_target.relevantAIId);

            if (ai != null)
            {
                _relevantAiName = ai.name;
            }
            else
            {
                _relevantAiName = "?";
            }
        }