// Execute the action public int Execute(HeroKitObject hko) { heroKitObject = hko; string title = StringFieldValue.GetValueA(heroKitObject, 0); ShowSaveGameMenu showMenu = new ShowSaveGameMenu(); HeroKitObject targetObject = showMenu.SetupSaveMenu(title, 2); bool runThis = (targetObject != null); if (runThis) { // menu was called from start menu bool calledFromStartMenu = BoolValue.GetValue(heroKitObject, 1); targetObject.heroList.bools.items[1].value = calledFromStartMenu; // enable the canvas Canvas canvas = targetObject.GetHeroComponent <Canvas>("Canvas"); canvas.enabled = true; } if (heroKitObject.debugHeroObject) { Debug.Log(HeroKitCommonRuntime.GetActionDebugInfo(heroKitObject)); } return(-99); }
// This is used by HeroKitCommon.GetAction() to add this action to the ActionDictionary. Don't delete! public static ShowSaveGameMenu Create() { ShowSaveGameMenu action = new ShowSaveGameMenu(); return(action); }