コード例 #1
0
    void Awake()
    {
        if (string.IsNullOrEmpty(saveName))
        {
            Debug.LogError("FATAL: No canvas given.");
            return;
        }

        canvas = NodeEditorSaveManager.LoadSceneNodeCanvas(saveName, false);
        NodeEditor.RecalculateAll(canvas);
        Debug.Log("Nodegraph loaded.");
        if (canvas.nodes.Count <= 0)
        {
            return;
        }
        foreach (Node node in canvas.nodes)       // searching for appropiate root
        {
            if (node is DialogueRoot)
            {
                Traverse(node, null);
                break;
            }
        }
        isExhausted     = false;
        guiManager      = new GUITextManager(this);
        audio           = GetComponent <AudioSource>();
        dialogueField   = GameObject.FindGameObjectWithTag("Dialogue Text");
        triggerDistance = 50;
    }
コード例 #2
0
    // Use this for initialization

    void Start()
    {
        craftingInterface = GetComponentInParent <CraftingInterface>();
        Debug.Log(craftingInterface.saveName);
        myButton = GameObject.Find("CraftButton").GetComponent <Button>();
        canvas   = NodeEditorSaveManager.LoadSceneNodeCanvas("CraftingCanvas", false);
    }
コード例 #3
0
ファイル: RuntimeNodeEditor.cs プロジェクト: leeeennyy/ETSM
        public void LoadSceneNodeCanvas(string path)
        {
            // Try to load the NodeCanvas
            if ((canvas = NodeEditorSaveManager.LoadSceneNodeCanvas(path, true)) == null)
            {
                NewNodeCanvas();
                return;
            }
            state = NodeEditorSaveManager.ExtractEditorState(canvas, "MainEditorState");

            NodeEditor.RecalculateAll(canvas);
        }
コード例 #4
0
 public void LoadSceneNodeCanvas(string path)
 {
     if ((Object)(canvas = NodeEditorSaveManager.LoadSceneNodeCanvas(path, true)) == (Object)null)
     {
         NewNodeCanvas();
     }
     else
     {
         state = NodeEditorSaveManager.ExtractEditorState(canvas, "MainEditorState");
         NodeEditor.RecalculateAll(canvas);
     }
 }
コード例 #5
0
        /// <summary>
        /// Loads the mainNodeCanvas and it's associated mainEditorState from an asset at path
        /// </summary>
        public void LoadSceneNodeCanvas(string path)
        {
            // Try to load the NodeCanvas
            if ((mainNodeCanvas = NodeEditorSaveManager.LoadSceneNodeCanvas(path, true)) == null)
            {
                NewNodeCanvas();
                return;
            }
            mainEditorState = NodeEditorSaveManager.ExtractEditorState(mainNodeCanvas, "MainEditorState");

            openedCanvasPath = path;
            NodeEditor.RecalculateAll(mainNodeCanvas);
            Repaint();
        }
コード例 #6
0
    void Start()
    {
        canvas = NodeEditorSaveManager.LoadSceneNodeCanvas("CraftingCanvas", false);
        Debug.Log(canvas);
        IngredientNode iNode = Instantiate(canvas.nodes.Find(x => ((IngredientNode)x).ingredientName == "Green Herb")) as IngredientNode;
        BaseItem       item_ = new BaseItem(iNode);

        _inventory.Add(item_);
        iNode = Instantiate(canvas.nodes.Find(x => ((IngredientNode)x).ingredientName == "Blue Herb")) as IngredientNode;
        item_ = new BaseItem(iNode);
        _inventory.Add(item_);
        iNode = Instantiate(canvas.nodes.Find(x => ((IngredientNode)x).ingredientName == "Green Herb")) as IngredientNode;
        item_ = new BaseItem(iNode);
        _inventory.Add(item_);
        iNode = Instantiate(canvas.nodes.Find(x => ((IngredientNode)x).ingredientName == "Blue Herb")) as IngredientNode;
        item_ = new BaseItem(iNode);
        _inventory.Add(item_);
    }
コード例 #7
0
    private void Awake()
    {
        if (string.IsNullOrEmpty(saveName))
        {
            Debug.LogError("CRITICAL: CraftingInterface has no save name");
            return;
        }

        canvas = NodeEditorSaveManager.LoadSceneNodeCanvas(saveName, false);
        NodeEditor.RecalculateAll(canvas);

        if (canvas != null)
        {
            Debug.Log("NodeGraph loaded.");
        }
        else
        {
            Debug.Log("Good job, no NodeGraph found.");
        }
    }