private void AddSlotEmployee()
    {
        List <EmployeeData> employeeDatas = EmployeeStructure.instance.GetMyEmployeeDataList();

        for (int i = 0; i < employeeDatas.Count; i++)
        {
            EmployeeData employeeData_temp = employeeDatas[i];
            SlotEmployee SlotEmployee_temp = Instantiate(slotEmployee, content).GetComponent <SlotEmployee>();
            SlotEmployee_temp.Set(employeeData_temp);
            SlotEmployee_temp.ShowCardMode();

            if (productMode)
            {
                if (!employeeData_temp.haveWork && product.employee_Worker.Count < maxEmployeeContent)
                {
                    SlotEmployee_temp.AddMemberMode(product, refresh);
                }
            }
            else if (outsourceMode)
            {
                if (!employeeData_temp.haveWork && contractData.employee_Worker.Count < maxEmployeeContent)
                {
                    SlotEmployee_temp.AddMemberMode(contractData, refresh);
                }
            }
            else if (researchMode)
            {
                if (!employeeData_temp.haveWork && componentData.employee_Worker.Count < maxEmployeeContent)
                {
                    SlotEmployee_temp.AddMemberMode(componentData, refresh);
                }
            }
        }
    }
Exemple #2
0
    private void AddSlotEmployee(ComponentData componentData)
    {
        List <string> employeeIDs = componentData.employee_Worker;

        for (int i = 0; i < CompanyStructure.instance.GetMaxSlot().maxResearchMember; i++)
        {
            if (i < employeeIDs.Count)
            {
                SlotEmployee slotEmployee_temp = Instantiate(slotEmployee, memberContent).GetComponent <SlotEmployee>();
                EmployeeData employeeData_temp = EmployeeStructure.instance.GetMyEmployeeData(employeeIDs[i]);
                slotEmployee_temp.Set(employeeData_temp);

                slotEmployee_temp.RemoveMemberMode(componentData, () => RefreshSlotEmployee(componentData));
            }
            else
            {
                Instantiate(selectEmployeeButton, memberContent).GetComponent <SelectEmployeeButton>().Set(componentData, () => RefreshSlotEmployee(componentData), CompanyStructure.instance.GetMaxSlot().maxResearchMember);
            }
        }
    }
    private void AddSlotEmployee()
    {
        List <string> employeeIDs = product.employee_Worker;

        for (int i = 0; i < CompanyStructure.instance.GetMaxSlot().maxProductMember; i++)
        {
            if (i < employeeIDs.Count)
            {
                SlotEmployee slotEmployee_temp = Instantiate(slotEmployee, contentEmployee).GetComponent <SlotEmployee>();
                EmployeeData employeeData_temp = EmployeeStructure.instance.GetMyEmployeeData(employeeIDs[i]);
                slotEmployee_temp.Set(employeeData_temp);

                slotEmployee_temp.RemoveMemberMode(product, RefreshSlotEmployee);
            }
            else
            {
                Instantiate(selectEmployeeButton, contentEmployee).GetComponent <SelectEmployeeButton>().Set(product, () =>
                {
                    RefreshSlotEmployee();
                }, CompanyStructure.instance.GetMaxSlot().maxProductMember);
            }
        }
    }