Exemplo n.º 1
0
    /* xSetItem
     * called by cropbehavior when slotting a new item,
     * code varies by type of station and type of crop
     * also sets buff values*/
    public virtual void SetItem(Utilities.CropTypes crop_in, Utilities.ItemTypes itemType_in, float restQuality_in, CropsAndBuffs.Buff buff_in)
    {
        timeToProduce = maxProductionTime;

        if (citizen1 != null)
        {
            citizen1Script.SetTaskAttributes(primaryEff, secondaryEff, primaryQual, secondaryQual, fatigueRate);

            Activate();
        }

        if (citizen2 != null)
        {
            citizen2Script.SetTaskAttributes(primaryEff, secondaryEff, primaryQual, secondaryQual, fatigueRate);

            Activate();
        }

        Utilities.SetCropTexture(this.gameObject.transform.GetChild(1).gameObject, crop_in);

        if (gameController.selectedTask == this.gameObject)
        {
            GameObject.Find("Current_Task_UI").GetComponent <CurrentTaskUI_Script>().SetTask();
        }
    }