Ejemplo n.º 1
0
 public Transition(AIAnimatorController _myController, int _start, int _end, float _offset)
 {
     myController = _myController;
     startId      = _start;
     endId        = _end;
     offset       = _offset;
     conditions   = new List <Condition>();
 }
 protected void Clone(AIAnimatorController _target)
 {
     this.nodes         = new List <Node>(_target.nodes.Count);
     this.animNodeCount = _target.animNodeCount;
     this.parameters    = new List <Parameter>(_target.parameters);
     foreach (Node node in _target.nodes)
     {
         this.nodes.Add((Node)node.Clone());
     }
 }
        public void Init(AIAnimatorController _controller)
        {
            controller = _controller;
            controller.OnEditorWindowOpen(this);

            isConnecting         = false;
            connectionStart      = null;
            gridTexture          = Resources.Load("Grid", typeof(Texture2D)) as Texture2D;
            arrowTexture         = Resources.Load("Arrow", typeof(Texture2D)) as Texture2D;
            gridTexture.wrapMode = TextureWrapMode.Repeat;

            parametersWindow = new ParametersWindow(new Rect(0, 0, 0, 0), this);
            windowsOpen.Add(parametersWindow);

            controller.panX = areaSize.x / 2;
            controller.panY = areaSize.y / 2;
        }
Ejemplo n.º 4
0
        public void Initalize(AIAnimatorController _copy, MeshRenderer[] _meshRenderers, UpdateStarter _updateStarter)
        {
            entryNodeId  = _copy.entryNodeId;
            runtimeNodes = new List <Node>();
            nodes        = _copy.nodes;

            foreach (Node node in _copy.nodes)
            {
                runtimeNodes.Add((Node)node.Clone());
            }

            foreach (Parameter parameter in _copy.parameters)
            {
                parameters.Add(parameter.Clone());
            }

            meshRenderers = _meshRenderers;
            updateStarter = _updateStarter;

            foreach (Node animationNode in runtimeNodes)
            {
                animationNode.OnRuntimeInitialize(this);
            }
        }
        public static void ShowEditor(AIAnimatorController _controller)
        {
            AIAnimatorControllerWindow editor = (AIAnimatorControllerWindow)EditorWindow.GetWindow(typeof(AIAnimatorControllerWindow), false);

            editor.Init(_controller);
        }
Ejemplo n.º 6
0
        //Editor Stuff
#if UNITY_EDITOR
        public void OnEditorWindowOpen(AIAnimatorControllerWindow _graph)
        {
            graph        = _graph;
            myController = _graph.controller;
        }
Ejemplo n.º 7
0
        void OnEnable()
        {
            AIAnimatorController controller = (AIAnimatorController)target;

            AIAnimatorControllerWindow.ShowEditor((controller));
        }