void PowerOff() { Recipe_v1_2 r = GetOrderRecipe(); onOMPowerOff.Invoke(r); ResetMachine(); }
Recipe_v1_2 GetOrderRecipe() { OrderSlot_v1_2 slot = GetComponentInChildren <OrderSlot_v1_2>(); Order_v1_2 order = slot.o; Recipe_v1_2 r = order.recipe.GetComponent <Recipe_v1_2>(); return(r); }
void PowerOn() { LED.gameObject.GetComponent <MeshRenderer>().material = LEDOn; poweredOn = true; Recipe_v1_2 r = GetOrderRecipe(); onOMPowerOn.Invoke(r); }
void StartRecipe(Recipe_v1_2 r) { refRecipe = GameObject.Instantiate(r.assembledPrefab, Vector3.zero, Quaternion.identity); refRecipe.parent = gameObject.transform; refRecipe.position = r.assembledPrefab.position; refRecipe.rotation = r.assembledPrefab.rotation; SetupNextPlaceholder(); }
void ShowDisplay(Recipe_v1_2 r) { display.gameObject.SetActive(true); // FIXME: the prefab instancing each time the order machine powers on can be avoided for performance reasons by caching // the last recipe shown, so to check whether the new recipe is the same as the current one, and if so use the already instanced prefab Transform disRecipe = GameObject.Instantiate(r.disassembledPrefab, recipePos.position, recipePos.rotation); disRecipe.parent = recipePos; }
void HandleButtonClick() { if (RecipeController_v1_2.isCompleted) { onOMDispatchSuccess.Invoke(); Recipe_v1_2 r = GetOrderRecipe(); int score = RecipeManager_v1_2.instance.GetRecipeScore(null, r); Debug.Log("Well done! Your " + r.name + " gave you " + score + " points"); ResetMachine(); } else { onOMDispatchError.Invoke(); } }
void HideDisplay(Recipe_v1_2 r) { ClearDisplay(); }
void PlayPowerOff(Recipe_v1_2 r) { audioSrc.PlayOneShot(powerOffClip); }
public int GetRecipeScore(List <string> ings, Recipe_v1_2 r) { // TODO! return(Random.Range(0, 100)); }
void ResetRecipe(Recipe_v1_2 r) { Reset(); }