// 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; }
void Start() { CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>(); CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>(); TimeManangerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); TechRecipeCall = GameObject.Find("BaseSystem").GetComponent <TechRecipe>(); GoodsRecipeCall = GameObject.Find("BaseSystem").GetComponent <GoodsRecipe>(); PanelControllerCall = GameObject.Find("Canvas").GetComponent <PanelController>(); AvailableRecipe = new List <RecipeInfo>(); Initializing(); }
// Start is called before the first frame update void Start() { BaseSystem = GameObject.Find("BaseSystem"); ObjectActCall = gameObject.GetComponent <InstallableObjectAct>(); CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>(); CompanyValueCall = ObjectActCall.CompanyValueCall; TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); TechRecipeCall = BaseSystem.GetComponent <TechRecipe>(); TechValueCall = CompanyManagerCall.GetCompanyValue(CompanyValueCall.CompanyName).GetTechValue().GetComponent <TechValue>(); NotificationManagerCall = GameObject.Find("NotificationManager").GetComponent <NotificationManager>(); GoodsRecipeCall = BaseSystem.GetComponent <GoodsRecipe>(); PanelControllerCall = GameObject.Find("Canvas").GetComponent <PanelController>(); CurrentResearchingTech = null; resultObject = new ResultObject(); }
void Awake() { CallGoodsRecipe = GameObject.Find("BaseSystem").GetComponent <GoodsRecipe>(); CallTechRecipe = GameObject.Find("BaseSystem").GetComponent <TechRecipe>(); CallTechValue = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetTechValue().GetComponent <TechValue>(); PlayerCompanyName = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().PlayerCompanyName; ImageObject = BasicInfoPanel.transform.GetChild(1).GetChild(0).gameObject; NameTextObject = BasicInfoPanel.transform.GetChild(3).GetChild(0).GetChild(1).gameObject; TypeTextObject = BasicInfoPanel.transform.GetChild(3).GetChild(1).GetChild(1).gameObject; CompanyTextObject = BasicInfoPanel.transform.GetChild(3).GetChild(2).GetChild(1).gameObject; ExpectQualityTextObject = BasicInfoPanel.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; PerfectionPointTextObject = StatInfoPanel.transform.GetChild(5).GetChild(1).GetChild(1).gameObject; PackagedValueImage = StatInfoPanel.transform.GetChild(6).GetChild(1).GetChild(1).gameObject; ChangeCostPanel = MainFunctionButtonPanel.transform.GetChild(1).gameObject; MainFunctionButton = MainFunctionButtonPanel.transform.GetChild(3).gameObject; }
// Start is called before the first frame update void Awake() { CallTimeManager = GameObject.Find("TimeManager").GetComponent <TimeManager>(); CallTechValue = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetTechValue().GetComponent <TechValue>(); CallTechRecipe = GameObject.Find("BaseSystem").GetComponent <TechRecipe>(); TitleImageObject = BasicInfoPanel.transform.GetChild(1).GetChild(0).gameObject; NameTextObject = BasicInfoPanel.transform.GetChild(3).GetChild(0).GetChild(1).gameObject; ResultObjectFirstRowPanel = BasicInfoPanel.transform.GetChild(3).GetChild(1).GetChild(1).gameObject; ResultObjectSecondRowPanel = BasicInfoPanel.transform.GetChild(3).GetChild(2).GetChild(1).gameObject; ResultValuePanel = ResultObjectFirstRowPanel = BasicInfoPanel.transform.GetChild(3).GetChild(3).GetChild(1).gameObject; ProgressBarImageObject = 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; ConfirmButtonObject = ConfirmPanel.transform.GetChild(1).gameObject; ConfirmButtonTextObject = ConfirmButtonObject.transform.GetChild(0).gameObject; }
public Attractiveness CalculateAttractiveness(string[] SelectedObject, string requiredProcessor) { TechRecipe CallTechRecipe = GameObject.Find("BaseSystem").GetComponent <TechRecipe>(); GoodsRecipe.Attractiveness attractiveness = new GoodsRecipe.Attractiveness(); if (requiredProcessor != null) { string ProcessorName = requiredProcessor.Split('?')[0]; string ActorName = requiredProcessor.Split('?')[1]; foreach (var Actor in CallTechRecipe.ActorList) { if (Actor.Name == ActorName) { attractiveness.TechPoint = Actor.TechPoint; break; } } foreach (var Processor in CallTechRecipe.ProcessorList) { if (Processor.Name == ProcessorName) { attractiveness.TechPoint += Processor.PerformanceQuality; } } } float sumMaterialPoints = 0f; bool isPackaged = false; foreach (var ObjectName in SelectedObject) { foreach (var ExistRecipe in RecipeArray) { if (ExistRecipe.OutputName == ObjectName) { if (ExistRecipe.Type != "Box") { sumMaterialPoints += ((ExistRecipe.Attractiveness.MaterialPoint + ExistRecipe.Attractiveness.TechPoint) / 2f); } else { isPackaged = true; } attractiveness.LookPoint += ExistRecipe.Attractiveness.LookPoint; break; } } } if (isPackaged) { attractiveness.MaterialPoint = sumMaterialPoints / (SelectedObject.Length - 1); attractiveness.isPackaged = true; } else { attractiveness.MaterialPoint = sumMaterialPoints / SelectedObject.Length; } attractiveness.TotalPoint = attractiveness.MaterialPoint * attractiveness.TechPoint + attractiveness.LookPoint; attractiveness.PerfectionPoint = 0; return(attractiveness); }