Esempio n. 1
0
 public void Reset(ZoomerSettings settings = null)
 {
     if (settings == null)
     {
         zoomOrigin = Vector2.zero;
         zoomScale  = 1;
     }
     else
     {
         zoomOrigin = settings.zoomOrigin;
         zoomScale  = settings.zoomScale;
     }
 }
        public void ConstructNodes()
        {
            if (nodeObjects == null)
            {
                InitializeNodeDictionary();
            }

            serializedObject = new SerializedObject(this);

            if (nodeObjects.Count == 0)
            {
                if (OhBehaveEditorWindow.SequenceNodeStyle == null)
                {
                    return;
                }

                var winData = new Rect(
                    -OhBehaveEditorWindow.SequenceNodeStyle.size.x / 2,
                    -OhBehaveEditorWindow.SequenceNodeStyle.size.y,
                    OhBehaveEditorWindow.SequenceNodeStyle.size.x,
                    OhBehaveEditorWindow.SequenceNodeStyle.size.y);

                NodeEditorObject newNode = new NodeEditorObject(NodeType.Sequence, ROOT_INDEX)
                {
                    description = "The Root Node - where it all begins",
                    displayName = "Root",
                    windowRect  = winData,
                };

                AddNewNode(newNode, 0);
                jsonTreeData.rootNode = new JsonNodeData {
                    nodeType = NodeType.Sequence
                };

                zoomerSettings = new ZoomerSettings();
                AssetDatabase.Refresh();
                EditorUtility.SetDirty(this);
                save = true;
            }
        }
Esempio n. 3
0
 public void Update(ZoomerSettings zoomerSettings)
 {
     zoomerSettings.zoomOrigin = zoomOrigin;
     zoomerSettings.zoomScale  = zoomScale;
 }