Ejemplo n.º 1
0
    public void MineralProcess()
    {
        int mineralsCount = inventory.mineralsCount;

        inventory.ClearMineralsCount();

        PlayFurnaceSound();

        //machine animation
        if (furnaceAnimator && !string.IsNullOrEmpty(furnaceTakeAction))
        {
            furnaceAnimator.Play(furnaceTakeAction);
        }

        mFurnaceActionLastTime = Time.time;
        if (mFurnaceActionRout == null)
        {
            mFurnaceActionRout = StartCoroutine(DoFurnaceAction());
        }

        if (mineralsCount < inventory.magma.capacity)
        {
            inventory.magma.count += inventory.magma.capacity;
        }
        else
        {
            inventory.magma.count += mineralsCount;
        }

        RefreshFireDisplay();

        StartCoroutine(DoChangeInterface());

        //show exit
        exitInstructGO.SetActive(true);
    }