Exemple #1
0
        private void GenerateDebugGraph()
        {
#if UNITY_EDITOR && DRAW_DEBUG
            if (_debugDrawer != null)
            {
                _debugDrawer.RemoveGraph(gameObject);

                _graph = new LineDrawer.Graph()
                {
                    CentrePoint = gameObject,
                    Points      = Neighbours.ConvertAll <GameObject>(node => node.gameObject).ToArray()
                };

                _debugDrawer.AddGraph(_graph);
            }
#endif //UNITY_EDITOR && DRAW_DEBUG
        }
Exemple #2
0
        protected override void Update()
        {
            base.Update();

            RefreshText();

            List <BaseCharacterController> visibleCharacters = App.AIBlackboard.GetVisibleCharacters(_owner);

            GameObject[] visible = new GameObject[visibleCharacters.Count];
            for (int idx = 0; idx < visibleCharacters.Count; idx++)
            {
                visible[idx] = visibleCharacters[idx].gameObject;
            }

            LineDrawer.Graph graph = new LineDrawer.Graph()
            {
                CentrePoint = _owner.gameObject, Points = visible
            };
            _drawer.AddGraph(graph);
        }