// Use this for initialization void Start() { craftingInterface = GetComponentInParent <CraftingInterface>(); Debug.Log(craftingInterface.saveName); myButton = GameObject.Find("CraftButton").GetComponent <Button>(); canvas = NodeEditorSaveManager.LoadSceneNodeCanvas("CraftingCanvas", false); }
void OnGUI() { if (GUI.Button(new Rect(5, 85, 60, 20), "TEST")) { CraftingInterface c = GetComponent <CraftingInterface>(); Debug.Log(c); c.Register("Penis Herb"); c.Register("V****a Herb"); Node node = c.Retrieve(); IngredientNode iNode = node as IngredientNode; if (iNode != null) { Debug.Log(iNode.ingredientName); } } }
// Use this for initialization void OnGUI() { if (GUI.Button(new Rect(5, 85, 60, 20), "TEST")) { CraftingInterface c = GetComponent <CraftingInterface>(); Debug.Log(c); c.Register("Green Herb"); c.Register("Blue Herb"); Node node = c.Retrieve(); IngredientNode recipe = node as IngredientNode; if (recipe != null) { Debug.Log(recipe.ingredientName); } } }
public override void OnInspectorGUI() { CraftingInterface crafting = target as CraftingInterface; if (crafting.saveChoices == null) { crafting.saveChoices = NodeEditorSaveManager.GetSceneSaves(); } if (crafting.saveChoices.Length == 0) { return; } EditorGUILayout.BeginHorizontal(); GUILayout.Label("Nodegraph:"); var newChoice = EditorGUILayout.Popup(crafting.saveChoice, crafting.saveChoices); EditorGUILayout.EndHorizontal(); if (newChoice != crafting.saveChoice) { crafting.saveChoice = newChoice; crafting.saveName = crafting.saveChoices[crafting.saveChoice]; crafting.Reset(); } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Force Reloading")) { crafting.Reset(); } if (GUILayout.Button("Reload saves")) { crafting.saveChoices = NodeEditorSaveManager.GetSceneSaves(); } EditorGUILayout.EndHorizontal(); DrawDefaultInspector(); }