public void ShowFeedback(bool success) { GameObject instance = null; instance = (success) ? displayPanel.instantiatePanel(right) : displayPanel.instantiatePanel(wrong); instance.SetActive(true); }
void Start() { // Load the timer displayPanel = GetComponent <DisplayPanel>(); _instanceTimer = displayPanel.instantiatePanel(timer); _counter = _instanceTimer.GetComponent <Counter>(); lastStep = new Step(); _currentStep = 0; _counterHints = 0; _gameCompleted = false; _instanceButtonPanel = displayPanel.instantiatePanel(buttonPanel); _instanceRecipePanel = displayPanel.instantiatePanel(recipePanel); UpdateHintsCounter(MAX_HINTS); _instanceRecipePanel.SetActive(true); _instanceButtonPanel.SetActive(false); enableClickOnObjects(false); // Tracker: recogemos el nombre del nivel this.level = SceneManager.GetActiveScene().name; /*string var = ""; * * for (int i = 0; i < this.steps.Count; i++) * { * var += i + ":" + steps[i].drag.name + "-" + steps[i].drop.name + "-" + steps[i].action; * } * * Tracker.T.setVar("Pasos", var);*/ Tracker.T.setVar("Tiempo", MAXTIME); Tracker.T.setVar("NumPasos", steps.Count); Tracker.T.Completable.Initialized(this.level); }
public void ItemWasDropped(GameObject drag, GameObject drop) { lastStep.drag = drag; lastStep.drop = drop; enableClickOnObjects(false); switch (drop.name) { case "Oven": displayPanel.instantiatePanel(ovenPanel, drag); break; case "Tap": displayPanel.instantiatePanel(tapPanel, drag); break; case "CeramicHob": displayPanel.instantiatePanel(ceramicHobPanel, drag); break; case "Table": displayPanel.instantiatePanel(tablePanel, drag); break; case "Refrigerator": displayPanel.instantiatePanel(refrigeratorPanel, drag); break; default: lastStep.action = Action.Ninguno; enableClickOnObjects(true); CheckStep(); break; } }