Esempio n. 1
0
    void CreateGoods()
    {
        if (GoodsValueCall.GetGoodsCount(TargetGoodsName, true) <= 0)
        {
            ObjectActCall.IsWorking = false;

            return;
        }

        if (Mover.GetComponent <BeltAct>().GoodsOnBelt == null && DummyBeltActCall.GoodsOnBelt == null)
        {
            ObjectActCall.IsWorking = true;

            GameObject newGoods = Goods.GetComponent <GoodsInstantiater>().CreateGoods(TargetGoodsName);
            newGoods.transform.position  = new Vector3(DummyBelt.transform.position.x, DummyBelt.transform.position.y + 0.325f, DummyBelt.transform.position.z);
            DummyBeltActCall.GoodsOnBelt = newGoods;
        }
        else
        {
            ObjectActCall.IsWorking = false;
        }
    }
Esempio n. 2
0
    void StockManage()
    {
        int Difference = 0;

        switch (Name)
        {
        case "General Industry Co.":
            Difference = 999 - GoodsValueCall.GetGoodsCount("Paper roll", true);
            if (Difference > 0)
            {
                for (int i = 0; i < Difference; i++)
                {
                    GoodsValueCall.AddGoodsArray("Paper roll", Random.Range(0.8f, 1f));
                }
            }
            break;

        case "Federal Agency of Industry":
            Difference = 999 - GoodsValueCall.GetGoodsCount("Plastic mass", true);
            if (Difference > 0)
            {
                for (int i = 0; i < Difference; i++)
                {
                    GoodsValueCall.AddGoodsArray("Plastic mass", Random.Range(0.5f, 1f));
                }
            }

            Difference = 999 - GoodsValueCall.GetGoodsCount("Silicon mass", true);
            if (Difference > 0)
            {
                for (int i = 0; i < Difference; i++)
                {
                    GoodsValueCall.AddGoodsArray("Silicon mass", Random.Range(0.7f, 1f));
                }
            }
            break;
            // case "Sasio" :
            //     Difference = 999 - GoodsValueCall.GetGoodsCount("Packaged Cal-100", true);
            //     if(Difference > 0)
            //     {
            //         for(int i = 0; i < Difference; i++)
            //         {
            //             GoodsValueCall.AddGoodsArray("Packaged Cal-100", Random.Range(0.6f, 0.8f));
            //         }
            //     }
            //     Difference = 999 - GoodsValueCall.GetGoodsCount("Cal-100", true);
            //     if(Difference > 0)
            //     {
            //         for(int i = 0; i < Difference; i++)
            //         {
            //             GoodsValueCall.AddGoodsArray("Cal-100", Random.Range(0.6f, 0.8f));
            //         }
            //     }
            //     Difference = 999 - GoodsValueCall.GetGoodsCount("CM100", true);
            //     if(Difference > 0)
            //     {
            //         for(int i = 0; i < Difference; i++)
            //         {
            //             GoodsValueCall.AddGoodsArray("CM100", Random.Range(0.6f, 0.8f));
            //         }
            //     }
            //     break;
        }

        SalesValueCall.UpdateItemCount(Name);
    }