public ROSApp ShowApp(ROSApp app) { if (app.IsSingleton()) { if (openSingletonApps.ContainsKey(app.GetType())) { ROSApp singletonApp = openSingletonApps[app.GetType()]; singletonApp.Open(); return(singletonApp); } else { // move to display area (to make sure we don't duplicate app.transform.SetParent(appDisplayArea, true); app.Open(); openSingletonApps.Add(app.GetType(), app); return(app); } } // duplicate gameobject and put under working area GameObject appObj = Instantiate(app.gameObject, appDisplayArea); ROSApp newApp = appObj.GetComponent <ROSApp>(); newApp.Open(); return(newApp); }
public ROSApp ShowDialogue(ROSApp app) { // duplicate gameobject and put under working area GameObject appObj = Instantiate(app.gameObject, dialogueDisplayArea); ROSApp newApp = appObj.GetComponent <ROSApp>(); // hide old one if (openDialogueStack.Count != 0) { openDialogueStack.Peek().Hide(); } openDialogueStack.Push(newApp); newApp.AddResponseAction(DialogueClosed); blockingArea.alpha = 1f; blockingArea.blocksRaycasts = true; newApp.Open(); return(newApp); }