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; }
// Use this for initialization void Start() { craftingInterface = GetComponentInParent <CraftingInterface>(); Debug.Log(craftingInterface.saveName); myButton = GameObject.Find("CraftButton").GetComponent <Button>(); canvas = NodeEditorSaveManager.LoadSceneNodeCanvas("CraftingCanvas", false); }
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); }
public void LoadSceneNodeCanvas(string path) { if ((Object)(canvas = NodeEditorSaveManager.LoadSceneNodeCanvas(path, true)) == (Object)null) { NewNodeCanvas(); } else { state = NodeEditorSaveManager.ExtractEditorState(canvas, "MainEditorState"); NodeEditor.RecalculateAll(canvas); } }
/// <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(); }
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_); }
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."); } }