public void SetName(DepControl Dep) { CurrentDep = Dep; Text_DepName.text = Dep.Text_DepName.text; if (Dep.type == EmpType.Tech) { dropdown.options[0].text = "程序迭代"; dropdown.options[1].text = "技术研发"; dropdown.options[2].text = "可行性调研"; } else if (Dep.type == EmpType.Market) { dropdown.options[0].text = "公关谈判"; dropdown.options[1].text = "营销文案"; dropdown.options[2].text = "资源拓展"; } else { dropdown.options[0].text = "原型图"; dropdown.options[1].text = "产品研究"; dropdown.options[2].text = "用户访谈"; } dropdown.value = 0; dopdown2.value = 0; }
public ProduceBuff(float value, DepControl Dep, int Time = 32) { Value = value; TimeLeft = Time; TargetDep = Dep; Dep.produceBuffs.Add(this); Dep.Efficiency += Value; TargetDep.GC.HourEvent.AddListener(TimePass); }
public void SetDice(DepControl dep) { CurrentPoint = 0; if (dep.SpTime > 0) { CurrentPoint += 5; } if (dep.EfficiencyLevel == 0) { RequirePoint = 20; } else if (dep.EfficiencyLevel == 1) { RequirePoint = 40; } else if (dep.EfficiencyLevel == 2) { RequirePoint = 80; } else if (dep.EfficiencyLevel == 3) { RequirePoint = 160; } else if (dep.EfficiencyLevel == 4) { RequirePoint = 320; } else if (dep.EfficiencyLevel == 5) { RequirePoint = 640; } if (GC.DoubleMobilizeCost > 0) { RequirePoint *= 2; } Text_Point.text = "当前点数:" + CurrentPoint + "\n下一级所需点数:" + RequirePoint; TargetDep = dep; ShowSkill(); for (int i = 0; i < dep.CurrentEmps.Count; i++) { for (int j = 0; j < dep.CurrentEmps[i].InfoDetail.SkillsInfo.Count; j++) { SkillInfo newSkill = Instantiate(SkillInfoPrefab, SkillSelectContent); newSkill.skill = dep.CurrentEmps[i].InfoDetail.SkillsInfo[j].skill; newSkill.SC = this; newSkill.empInfo = dep.CurrentEmps[i].InfoDetail; newSkill.UpdateUI(); newSkill.info = GC.infoPanel; TotalSkills.Add(newSkill); } } TotalValue = 0; RollButton.interactable = true; }
//将移动或雇佣的员工放入特定部门 + 选择部门发动建筑特效 + CEO技能发动 public void SelectDep(DepControl depControl) { if (SelectMode == 1) { //还需要重新计算工资 Salary += CurrentEmpInfo.CalcSalary(); depControl.CurrentEmps.Add(CurrentEmpInfo.emp); depControl.UpdateUI(); CurrentEmpInfo.emp.CurrentDep = depControl; SetInfoPanel(); CurrentEmpInfo.emp.InfoA.transform.parent = depControl.EmpContent; } else if (SelectMode == 2) { if (CurrentEmpInfo == CurrentEmpInfo.emp.InfoB) { CurrentEmpInfo = CurrentEmpInfo.emp.InfoA; } CurrentEmpInfo.transform.parent = depControl.EmpContent; ResetOldAssignment(); //修改新部门生产力显示 CurrentEmpInfo.emp.CurrentDep = depControl; depControl.CurrentEmps.Add(CurrentEmpInfo.emp); depControl.UpdateUI(); CurrentEmpInfo.DetailInfo.Entity.FindWorkPos(); } //选择部门发动建筑特效 else if (SelectMode == 5) { CurrentDep = depControl; CurrentOffice.BuildingActive(); } //CEO技能 else if (SelectMode == 6) { if (CEOSkillNum == 1) { new ProduceBuff(0.2f, depControl, 16); } else if (CEOSkillNum == 2) { depControl.SpTime += 16; } CEOSkillConfirm(); } DepSelectPanel.SetActive(false); }
public void ClearPanel() { for (int i = 0; i < Dices.Count; i++) { Destroy(Dices[i].gameObject); } for (int i = 0; i < CurrentSkills.Count; i++) { CurrentSkills[i].skill.DiceExtra = 0; CurrentSkills[i].skill.StaminaExtra = 0; Destroy(CurrentSkills[i].gameObject); } for (int i = 0; i < TotalSkills.Count; i++) { TotalSkills[i].skill.DiceExtra = 0; TotalSkills[i].skill.StaminaExtra = 0; Destroy(TotalSkills[i].gameObject); } if (CurrentPoint >= RequirePoint) { if (TargetDep.EfficiencyLevel < 5) { TargetDep.EfficiencyLevel += 1; } TargetDep.Efficiency += 0.2f; TargetDep.LevelDownTime = 96; TargetDep.Text_LevelDownTime.text = "降级时间:" + TargetDep.LevelDownTime + "时"; if (GC.DoubleMobilizeCost > 0) { GC.DoubleMobilizeCost -= 1; } } Dices.Clear(); SelectedDices.Clear(); CurrentSkills.Clear(); TotalSkills.Clear(); CurrentPoint = 0; EventLimit = 0; TargetDep = null; Sp1Active = false; Sp2Multiply = 0; Sp3Multiply = 0; Sp4Multiply = 0; Sp5Multiply = 0; this.gameObject.SetActive(false); }
public void ShowDepSelectPanel(DepControl dep) { //办公室领导选择 DepSelectPanel.SetActive(true); StandbyButton.SetActive(false); for (int i = 0; i < CurrentDeps.Count; i++) { CurrentDeps[i].DS.gameObject.SetActive(false); } for (int i = 0; i < CurrentOffices.Count; i++) { if (dep.InRangeOffices.Contains(CurrentOffices[i])) { CurrentOffices[i].DS.gameObject.SetActive(true); } else { CurrentOffices[i].DS.gameObject.SetActive(false); } } }
public void BuildingActive() { //建筑物特效 bool ActiveSuccess = true; float Posb = Random.Range(0.0f, 1.0f); float extra = GC.BuildingSkillSuccessExtra, extra2 = 0; if (extra > 0.2f) { extra2 = extra - 0.2f; } if (building.Type == BuildingType.人力资源部A) { int value = 0; if (Posb < 0.2f - extra) { value = 20; } else if (Posb < 0.8f - extra2) { value = 10; } else { value = 5; } value = (int)(value * GC.HRBuildingMentalityExtra); DepControl d = GC.CurrentDep; for (int i = 0; i < d.CurrentEmps.Count; i++) { d.CurrentEmps[i].Mentality += value; } } else if (building.Type == BuildingType.心理咨询室) { //还没写! } else if (building.Type == BuildingType.摩房) { List <DepControl> TDep = new List <DepControl>(); for (int i = 0; i < building.effect.AffectedBuildings.Count; i++) { if (building.effect.AffectedBuildings[i].Department != null) { TDep.Add(building.effect.AffectedBuildings[i].Department); } } int value = 0; if (Posb < 0.2f - extra) { value = 50; } else if (Posb < 0.8f - extra2) { value = 30; } else { value = 10; } for (int a = 0; a < TDep.Count; a++) { for (int i = 0; i < TDep[a].CurrentEmps.Count; i++) { TDep[a].CurrentEmps[i].Stamina += value; } } if (TDep.Count == 0) { ActiveSuccess = false; } } else if (building.Type == BuildingType.健身房) { List <DepControl> TDep = new List <DepControl>(); for (int i = 0; i < building.effect.AffectedBuildings.Count; i++) { if (building.effect.AffectedBuildings[i].Department != null) { TDep.Add(building.effect.AffectedBuildings[i].Department); } } int value = 0; if (Posb < 0.2f) { value = 30; } else if (Posb < 0.8f) { value = 20; } else { value = 10; } for (int a = 0; a < TDep.Count; a++) { for (int i = 0; i < TDep[a].CurrentEmps.Count; i++) { TDep[a].CurrentEmps[i].Stamina += value; float Posb2 = Random.Range(0.0f, 1.0f); if (Posb2 < 0.3f) { TDep[a].CurrentEmps[i].InfoDetail.AddPerk(new Perk3(TDep[a].CurrentEmps[i])); } } } if (TDep.Count == 0) { ActiveSuccess = false; } } else if (building.Type == BuildingType.目标修正小组) { if (GC.SC.TargetDep != null && building.effect.AffectedBuildings.Contains(GC.SC.TargetDep.building) && GC.SC.SelectedDices.Count == 3) { GC.SC.TotalValue = 0; for (int i = 0; i < GC.SC.SelectedDices.Count; i++) { GC.SC.SelectedDices[i].RandomValue(); GC.SC.TotalValue += GC.SC.SelectedDices[i].value; } } else { ActiveSuccess = false; } } else if (building.Type == BuildingType.档案管理室) { if (GC.SC.TargetDep != null && building.effect.AffectedBuildings.Contains(GC.SC.TargetDep.building) && GC.SC.SelectedDices.Count == 1) { GC.SC.SelectedDices[0].value += 1; GC.SC.SelectedDices[0].Text_Value.text = GC.SC.SelectedDices[0].value.ToString(); GC.SC.TotalValue += 1; } else { ActiveSuccess = false; } } else if (building.Type == BuildingType.效能研究室) { if (GC.SC.TargetDep != null && building.effect.AffectedBuildings.Contains(GC.SC.TargetDep.building)) { GC.SC.Sp1Active = true; } else { ActiveSuccess = false; } } else if (building.Type == BuildingType.财务部) { if (GC.SC.TargetDep != null && building.effect.AffectedBuildings.Contains(GC.SC.TargetDep.building) && GC.SC.SelectedDices.Count == 1) { GC.SC.SelectedDices[0].value -= 1; GC.SC.SelectedDices[0].Text_Value.text = GC.SC.SelectedDices[0].value.ToString(); GC.SC.TotalValue -= 1; } else { ActiveSuccess = false; } } else if (building.Type == BuildingType.战略咨询部B) { if (GC.SC.TargetDep != null && building.effect.AffectedBuildings.Contains(GC.SC.TargetDep.building) && GC.SC.SelectedDices.Count == 2) { GC.SC.Dices.Remove(GC.SC.SelectedDices[0]); GC.SC.Dices.Remove(GC.SC.SelectedDices[1]); Destroy(GC.SC.SelectedDices[0].gameObject); Destroy(GC.SC.SelectedDices[1].gameObject); GC.SC.SelectedDices.Clear(); GC.SC.TotalValue = 0; GC.SC.CreateDice(2, 6); } else { ActiveSuccess = false; } } else if (building.Type == BuildingType.精确标准委员会) { if (GC.SC.TargetDep != null && building.effect.AffectedBuildings.Contains(GC.SC.TargetDep.building) && GC.SC.SelectedDices.Count == 1) { int num = GC.SC.SelectedDices[0].value; GC.SC.Dices.Remove(GC.SC.SelectedDices[0]); Destroy(GC.SC.SelectedDices[0].gameObject); GC.SC.SelectedDices.Clear(); GC.SC.CreateDice(num, 1); GC.SC.TotalValue = 0; } else { ActiveSuccess = false; } } else if (building.Type == BuildingType.高级财务部A) { if (GC.SC.TargetDep != null && building.effect.AffectedBuildings.Contains(GC.SC.TargetDep.building) && GC.Money > 100000) { GC.Money -= 100000; GC.SC.CreateDice(1); } else { ActiveSuccess = false; } } else if (building.Type == BuildingType.高级财务部B) { if (GC.Money > 100000) { GC.Money -= 100000; GC.CurrentEmpInfo.emp.Mentality += 15; GC.SelectMode = 1; GC.TotalEmpContent.parent.parent.gameObject.SetActive(false); } else { ActiveSuccess = false; GC.SelectMode = 1; GC.TotalEmpContent.parent.parent.gameObject.SetActive(false); } } if (ActiveSuccess == true) { Progress = 0; Text_Progress.text = "激活进度:0%"; ActiveButton.interactable = false; GC.Stamina -= building.StaminaRequest; } }
public void SetHire(DepControl Dep) { CurrentDep = Dep; dropdown.value = 0; dopdown2.value = 0; }