Exemple #1
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);
            }
        }
    }