Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        ObjectActCall           = gameObject.GetComponent <InstallableObjectAct>();                                                                                      //InstallableObjectAct 호출
        GoodsValueCall          = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>(); //GoodsValue 호출
        CurrentJoinIndex        = 0;                                                                                                                                     //합칠 인덱스
        AddonObject             = null;                                                                                                                                  //애드온 오브젝트
        TargetGoods             = null;                                                                                                                                  //타겟 물품
        NoNeedCheckCurrentIndex = false;                                                                                                                                 //인덱스 확인 필요 여부
        CanProceed    = false;                                                                                                                                           //진행가능 여부
        isInitialized = false;                                                                                                                                           //진행 시작 가능 여부

        DetectedObject = new GameObject[InputNumber];                                                                                                                    //들어오는 벨트에 확인된 오브젝트들
        DetectSensor   = new GameObject[InputNumber];                                                                                                                    //들어오는 벨트 확인하는 센서들
        NextBelt       = new GameObject[InputNumber];
        PrevBelt       = null;
        PrevBelt2      = new GameObject[InputNumber];       //들어오는 벨트들
        NextBelt2      = null;


        for (int i = 0; i < InputNumber; i++)      //센서 오브젝트 받아오기
        {
            // 0 ; Left
            // 1 : Right
            DetectSensor[i] = transform.GetChild(2).GetChild(0).GetChild(i).gameObject;        //센서 호출
        }
    }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     BaseSystem      = GameObject.Find("BaseSystem");
     ValueCall       = BaseSystem.GetComponent <InGameValue>();
     GoodsValueCall  = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
     GoodsRecipeCall = BaseSystem.GetComponent <GoodsRecipe>();
 }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        GoodsValueCall  = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        GoodsRecipeCall = GameObject.Find("BaseSystem").GetComponent <GoodsRecipe>();;
        Goods           = GameObject.Find("Goods");
        ObjectActCall   = gameObject.GetComponent <InstallableObjectAct>();
        TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>();

        TargetGoodsRecipe = null;

        Mover         = new GameObject[InputNumber];
        PrevBelt      = new GameObject[InputNumber];
        MoverDetector = new GameObject[InputNumber];

        Transform DetectorCarrier = transform.GetChild(2);

        for (int i = 0; i < InputNumber; i++)
        {
            MoverDetector[i] = DetectorCarrier.GetChild(0).GetChild(i).gameObject;
        }

        RegisteredInput = new int[InputNumber];
        for (int i = 0; i < InputNumber; i++)
        {
            RegisteredInput[i] = -1;
        }

        WorkLoadPerDay         = 0;
        RealTimeWorkLoadPerDay = 0;

        TargetSetTime = -1;

        isWaiting = false;
    }
    // Start is called before the first frame update
    void Awake()
    {
        CallNotificationManager = GameObject.Find("NotificationManager").GetComponent <NotificationManager>();
        CallGoodsRecipe         = GameObject.Find("BaseSystem").GetComponent <GoodsRecipe>();
        CallGoodsValue          = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        CallTechRecipe          = GameObject.Find("BaseSystem").GetComponent <TechRecipe>();
        CallTechValue           = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetTechValue().GetComponent <TechValue>();
        CallTimeManager         = GameObject.Find("TimeManager").GetComponent <TimeManager>();
        CallObjInstantiater     = GameObject.Find("ObjectInstaller").GetComponent <ObjInstantiater>();

        int PanelListCount;

        OverViewPanels = new List <GameObject>();
        OverViewPanels.Add(InputPanel);
        OverViewPanels.Add(ResultArrowHolder);
        OverViewPanels.Add(ResultItemInfoPanel);
        OverViewPanels.Add(StatInfoPanel);
        OverViewPanels.Add(ProgressInfoPanel);
        OverViewPanels.Add(ConfirmPanel);
        PanelListCount = OverViewPanels.Count;
        for (int i = 0; i < PanelListCount; i++)
        {
            OverViewPanels.Add(FunctionPanel.transform.GetChild(OverViewPanels[i].transform.GetSiblingIndex() - 1).gameObject);
        }

        SelectModePanels = new List <GameObject>();
        SelectModePanels.Add(InputPanel);
        SelectModePanels.Add(ResultArrowHolder);
        SelectModePanels.Add(ResultItemInfoPanel);
        SelectModePanels.Add(StatInfoPanel);
        PanelListCount = SelectModePanels.Count;
        for (int i = 0; i < PanelListCount; i++)
        {
            SelectModePanels.Add(FunctionPanel.transform.GetChild(SelectModePanels[i].transform.GetSiblingIndex() - 1).gameObject);
        }

        FirstItemImageObject           = InputPanel.transform.GetChild(1).GetChild(0).gameObject;
        SecondItemImageObject          = InputPanel.transform.GetChild(5).GetChild(0).gameObject;
        ProcessorImageObject           = InputPanel.transform.GetChild(3).GetChild(0).gameObject;
        FirstItemNameTextObject        = InputNamePanel.transform.GetChild(1).gameObject;
        SecondItemNameTextObject       = InputNamePanel.transform.GetChild(5).gameObject;
        ProcessorNameTextObject        = InputNamePanel.transform.GetChild(3).gameObject;
        ResultItemImageObject          = ResultItemInfoPanel.transform.GetChild(1).GetChild(0).gameObject;
        ResultItemTypeTextObject       = ResultItemInfoPanel.transform.GetChild(3).GetChild(0).GetChild(1).gameObject;
        ResultItemNameInputFieldObject = ResultItemInfoPanel.transform.GetChild(3).GetChild(1).GetChild(1).gameObject;
        ExpectedCostTextObject         = ResultItemInfoPanel.transform.GetChild(3).GetChild(3).GetChild(1).gameObject;
        MaterialPointTextObject        = StatInfoPanel.transform.GetChild(1).GetChild(1).GetChild(1).gameObject;
        TechPointTextObject            = StatInfoPanel.transform.GetChild(2).GetChild(1).GetChild(1).gameObject;
        LookPointTextObject            = StatInfoPanel.transform.GetChild(3).GetChild(1).GetChild(1).gameObject;
        TotalPointTextObject           = StatInfoPanel.transform.GetChild(4).GetChild(1).GetChild(1).gameObject;
        PackagedImageObject            = StatInfoPanel.transform.GetChild(6).GetChild(1).GetChild(1).gameObject;
        ProgressBarObject            = ProgressInfoPanel.transform.GetChild(1).GetChild(0).GetChild(0).gameObject;
        ProgressPercentageTextObject = ProgressInfoPanel.transform.GetChild(1).GetChild(0).GetChild(1).gameObject;
        PassedTimeTextObject         = ProgressInfoPanel.transform.GetChild(1).GetChild(1).GetChild(0).GetChild(0).GetChild(0).gameObject;
        RemainTimeTextObject         = ProgressInfoPanel.transform.GetChild(1).GetChild(1).GetChild(0).GetChild(0).GetChild(1).gameObject;
        CompletedPointTextObject     = ProgressInfoPanel.transform.GetChild(1).GetChild(1).GetChild(1).GetChild(0).GetChild(0).gameObject;
        GainingPointTextObject       = ProgressInfoPanel.transform.GetChild(1).GetChild(1).GetChild(1).GetChild(0).GetChild(1).gameObject;
        RemainPointTextObject        = ProgressInfoPanel.transform.GetChild(1).GetChild(1).GetChild(1).GetChild(0).GetChild(2).gameObject;
        MainFunctionButton           = ConfirmPanel.transform.GetChild(1).gameObject;
    }
Ejemplo n.º 5
0
    // Start is called before the first frame update
    void Start()
    {
        GoodsValueCall     = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        AddonObjectActCall = gameObject.GetComponent <AddonObjectAct>();
        ObjectActCall      = gameObject.GetComponent <InstallableObjectAct>();

        LR            = 0;
        isInitialized = false;
    }
Ejemplo n.º 6
0
    // Start is called before the first frame update
    void Start()
    {
        GoodsValueCall  = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        ObjectActCall   = gameObject.GetComponent <InstallableObjectAct>();
        TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>();
        isWaiting       = false;
        isInitialized   = false;

        MoverDetector    = transform.GetChild(2).GetChild(0).GetChild(0).gameObject;
        PrevBeltDetector = transform.GetChild(2).GetChild(1).GetChild(0).gameObject;
    }
Ejemplo n.º 7
0
    // Start is called before the first frame update
    void Start()
    {
        BaseSystem         = GameObject.Find("BaseSystem");
        ObjectActCall      = gameObject.GetComponent <InstallableObjectAct>();
        CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>();
        GoodsValueCall     = CompanyManagerCall.GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        SalesValueCall     = GameObject.Find("SalesManager").GetComponent <SalesValue>();

        MoverDetector     = transform.GetChild(2).GetChild(0).GetChild(0).gameObject;
        WarehouseDetector = transform.GetChild(2).GetChild(1).GetChild(0).gameObject;

        isInitialized = false;
    }
Ejemplo n.º 8
0
    // Start is called before the first frame update
    void Start()
    {
        CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>();
        GoodsValueCall     = CompanyManagerCall.GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        SalesValueCall     = GameObject.Find("SalesManager").GetComponent <SalesValue>();
        ObjectActCall      = gameObject.GetComponent <InstallableObjectAct>();
        Goods            = GameObject.Find("Goods");
        DummyBeltActCall = DummyBelt.GetComponent <BeltAct>();

        MoverDetector     = transform.GetChild(2).GetChild(0).GetChild(0).gameObject;
        WarehouseDetector = transform.GetChild(2).GetChild(1).GetChild(0).gameObject;

        TargetGoodsName = "None";
    }
Ejemplo n.º 9
0
    void Awake()
    {
        CallTimeManager      = GameObject.Find("TimeManager").GetComponent <TimeManager>();
        CallCompanyManager   = GameObject.Find("CompanyManager").GetComponent <CompanyManager>();
        CallCompanyValue     = CallCompanyManager.GetPlayerCompanyValue();
        CallElectricityValue = CallCompanyValue.GetElectricityValue().GetComponent <ElectricityValue>();
        CallEmployeeValue    = CallCompanyValue.GetEmployeeValue().GetComponent <EmployeeValue>();
        CallGoodsValue       = CallCompanyValue.GetGoodsValue().GetComponent <GoodsValue>();
        CallFacilityValue    = CallCompanyValue.GetFacilityValue().GetComponent <FacilityValue>();

        ElectricityGraphPanelCarrier = GraphCarrier.transform.GetChild(0).gameObject;
        LaborForceGraphPanelCarrier  = GraphCarrier.transform.GetChild(2).gameObject;
        ProcessGraphPanelCarrier     = GraphCarrier.transform.GetChild(4).gameObject;
        ProcessGraphIndexPanel       = ProcessGraphIndexCarrier.transform.parent.gameObject;
    }
Ejemplo n.º 10
0
    // Start is called before the first frame update
    void Start()
    {
        CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>();
        GoodsValueCall   = CompanyValueCall.GetGoodsValue().GetComponent <GoodsValue>();
        TimaManagerCall  = GameObject.Find("TimeManager").GetComponent <TimeManager>();
        SalesValueCall   = GameObject.Find("SalesManager").GetComponent <SalesValue>();

        List <string> ItemList  = new List <string>();
        List <int>    PriceList = new List <int>();

        CompanyValueCall.GetGoodsValue().GetComponent <GoodsValue>().TotalCapacity = 9999999;

        switch (Name)
        {
        case "General Industry Co.":
            ItemList.Add("Paper roll");
            PriceList.Add(1);
            Initializing(ItemList, PriceList);
            break;

        case "Federal Agency of Industry":
            ItemList.Add("Plastic mass"); ItemList.Add("Silicon mass");
            PriceList.Add(2); PriceList.Add(3);
            Initializing(ItemList, PriceList);
            break;
            // case "Sasio" :
            //     ItemList.Add("Packaged Calculator"); ItemList.Add("Calculator"); ItemList.Add("Calculating Circuit");
            //     List<string> NameList = new List<string>();
            //     NameList.Add("Packaged Cal-100"); NameList.Add("Cal-100"); NameList.Add("CM100");
            //     PriceList.Add(18); PriceList.Add(13); PriceList.Add(10);
            //     GoodsRecipe GoodsRecipeCall = GameObject.Find("BaseSystem").GetComponent<GoodsRecipe>();
            //     TechValue TechValueCall = CompanyValueCall.GetTechValue().GetComponent<TechValue>();
            //     for(int i = 0; i < ItemList.Count; i++)
            //     {
            //         for(int j = 0; j < GoodsRecipeCall.RecipeArray.Count; j++)
            //         {
            //             if(GoodsRecipeCall.RecipeArray[j].OutputName == ItemList[i])
            //             {
            //                 GoodsRecipeCall.MakeCustomRecipe(ItemList[i], NameList[i], GoodsRecipeCall.RecipeArray[j].InputName, GoodsRecipeCall.RecipeArray[j].Attractiveness, Name);
            //                 SalesValueCall.AddSales(NameList[i], Name, PriceList[i]);
            //             }
            //         }
            //     }
            //     break;
        }

        StockManage();
    }
Ejemplo n.º 11
0
    void Awake()
    {
        CallGoodsValue  = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        CallGoodsRecipe = GameObject.Find("BaseSystem").GetComponent <GoodsRecipe>();

        ImageObject = ImageHolder.transform.GetChild(0).gameObject;
        RemainQuantityTextObject = ImageHolder.transform.GetChild(0).GetChild(0).gameObject;
        NameTextObject           = InfoPanel.transform.GetChild(1).GetChild(0).GetChild(1).gameObject;
        TypeTextObject           = InfoPanel.transform.GetChild(1).GetChild(1).GetChild(1).gameObject;
        CompanyTextObject        = InfoPanel.transform.GetChild(1).GetChild(2).GetChild(1).gameObject;
        MaterialPointTextObject  = InfoPanel.transform.GetChild(2).GetChild(0).GetChild(1).GetChild(1).gameObject;
        TechPointTextObject      = InfoPanel.transform.GetChild(2).GetChild(1).GetChild(1).GetChild(1).gameObject;
        LookPointTextObject      = InfoPanel.transform.GetChild(2).GetChild(2).GetChild(1).GetChild(1).gameObject;
        TotalPointTextObject     = InfoPanel.transform.GetChild(2).GetChild(3).GetChild(1).GetChild(1).gameObject;
        MainFunctionButton       = FunctionButtonPanel.transform.GetChild(0).gameObject;
    }
Ejemplo n.º 12
0
    // Start is called before the first frame update
    void Start()
    {
        ObjectActCall   = gameObject.GetComponent <InstallableObjectAct>();
        GoodsValueCall  = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        DistributeIndex = 0;
        AddonObject     = null;
        TargetGoods     = null;
        GetIndex        = false;
        CanProceed      = false;
        isInitialized   = false;

        Mover         = new GameObject[OutputNumber];
        MoverDetector = new GameObject[OutputNumber];
        NextBelt      = new GameObject[OutputNumber];
        PrevBelt      = null;

        for (int i = 0; i < OutputNumber; i++)
        {
            // 0 ; Left
            // 1 : Right
            MoverDetector[i] = transform.GetChild(2).GetChild(0).GetChild(i).gameObject;
        }
    }
Ejemplo n.º 13
0
    public List <float> BuyItem(string Name, string BuyerName, int Num)
    {
        List <float> result = new List <float>();
        int          Index  = getSalesIndex(Name);

        if (Index == -1)
        {
            Debug.Log("No Info of " + Name + ". Try from " + BuyerName);
            result.Add(-1f);
            return(result);
        }

        SalesInfo    TargetItem           = SalesItemArray[Index];
        GoodsValue   SellerGoodsValueCall = CompanyManagerCall.GetCompanyValue(TargetItem.Seller).GetGoodsValue().GetComponent <GoodsValue>();
        EconomyValue SellerEconomyCall    = CompanyManagerCall.GetCompanyValue(TargetItem.Seller).GetEconomyValue().GetComponent <EconomyValue>();

        int Limit = 0;

        if (TargetItem.ItemCount >= Num)
        {
            Limit = Num;
        }
        else if (TargetItem.ItemCount > 0)
        {
            Limit = TargetItem.ItemCount;
        }
        else
        {
            // Debug.Log("Lack of stock " + TargetItem.ItemCount + " " + Num);
            result.Add(-2f);
            return(result);
        }

        float TotalQualityValue = TargetItem.QualityEvaluation * TargetItem.SoldCount;

        for (int i = 0; i < Limit; i++)
        {
            int GoodsID = SellerGoodsValueCall.FindGoodsID(Name, false);
            if (GoodsID == -1)
            {
                Debug.Log("No Info of " + TargetItem.Seller + "'s " + Name + ". Try from " + BuyerName);
                result.Add(-1f);
                return(result);
            }

            if (BuyerName != "Consumer")
            {
                GoodsValue   BuyerGoodsValueCall = CompanyManagerCall.GetCompanyValue(BuyerName).GetGoodsValue().GetComponent <GoodsValue>();
                EconomyValue BuyerEconomyCall    = CompanyManagerCall.GetCompanyValue(BuyerName).GetEconomyValue().GetComponent <EconomyValue>();

                if (BuyerEconomyCall.Balance < TargetItem.Price)
                {
                    result.Add(0f);
                    return(result);
                }

                BuyerGoodsValueCall.AddGoodsArray(Name, SellerGoodsValueCall.CheckQuality(GoodsID));
                BuyerEconomyCall.AddHistory(TimeManagerCall.TimeValue, "Buy", Name, "Buy " + Name + " from " + TargetItem.Seller, -TargetItem.Price);
            }

            result.Add(SellerGoodsValueCall.CheckQuality(GoodsID));
            SellerGoodsValueCall.DeleteGoodsArray(GoodsID);
            SellerEconomyCall.AddHistory(TimeManagerCall.TimeValue, "Sell", Name, TargetItem.Seller + " Sells " + Name + " to " + BuyerName, TargetItem.Price);

            if (TargetItem.Seller == CompanyManagerCall.PlayerCompanyName && TargetItem.SoldCount == 0)
            {
                NotificationManagerCall.AddNews("Award", "Your first shipment of " + Name + " products has been made!");
            }

            TargetItem.ItemCount--;
            TargetItem.SoldCount++;
        }

        foreach (var quality in result)
        {
            TotalQualityValue += quality;
        }
        TargetItem.QualityEvaluation = TotalQualityValue / TargetItem.SoldCount;

        if (PanelControllerCall.CurrentSidePanel != null)
        {
            if (PanelControllerCall.CurrentSidePanel.name == "ContractPanel")
            {
                ContractPanelController PanelComponent = PanelControllerCall.CurrentSidePanel.GetComponent <ContractPanelController>();

                PanelComponent.UpdateRemainQuantityText();

                if (PanelComponent.CurrentItem == TargetItem.RecipeInfo.Recipe.OutputName)
                {
                    PanelComponent.UpdateSalesInfo();
                }
            }
        }

        return(result);
    }