Exemplo n.º 1
0
    void PowerOff()
    {
        Recipe_v1_2 r = GetOrderRecipe();

        onOMPowerOff.Invoke(r);

        ResetMachine();
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
    void PowerOn()
    {
        LED.gameObject.GetComponent <MeshRenderer>().material = LEDOn;
        poweredOn = true;

        Recipe_v1_2 r = GetOrderRecipe();

        onOMPowerOn.Invoke(r);
    }
Exemplo n.º 4
0
    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();
    }
Exemplo n.º 5
0
    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;
    }
Exemplo n.º 6
0
    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();
        }
    }
Exemplo n.º 7
0
 void HideDisplay(Recipe_v1_2 r)
 {
     ClearDisplay();
 }
Exemplo n.º 8
0
 void PlayPowerOff(Recipe_v1_2 r)
 {
     audioSrc.PlayOneShot(powerOffClip);
 }
Exemplo n.º 9
0
    public int GetRecipeScore(List <string> ings, Recipe_v1_2 r)
    {
        // TODO!

        return(Random.Range(0, 100));
    }
Exemplo n.º 10
0
 void ResetRecipe(Recipe_v1_2 r)
 {
     Reset();
 }