public void Reflect(List <AgentModel> list, List <AgentAllocateSlot> slotList) { List <AgentAllocateSlot> copyList = new List <AgentAllocateSlot>(slotList.ToArray()); slotList.Clear(); foreach (AgentModel model in list) { AgentAllocateSlot script = null; foreach (AgentAllocateSlot slot in copyList) { if (slot.id == model.instanceId) { script = slot; copyList.Remove(slot); break; } } if (script == null) { Debug.LogError("Slot finding failed"); return; } slotList.Add(script); } }
public void SetAllocateIndex(AgentModel model, int i) { AgentAllocateSlot slot = GetSlot(model); if (slot != null) { slot.SetAllocatedIndex(i); } }
public AgentAllocateSlot GetSlot(AgentModel target) { AgentAllocateSlot slot = null; foreach (AgentAllocateSlot s in this.currentSlotList) { if (s.CheckAgent(target)) { slot = s; break; } } return(slot); }
public void ChangedAgentSefira(AgentModel model, string sefira) { AgentAllocateSlot slot = GetSlot(model); if (slot != null) { if (sefira == "0") { slot.OnCancelAgent(); } else { slot.sets.SetAllocate(SefiraManager.instance.GetSefira(sefira)); } } }
public void AddAgent(AgentModel model) { agentList.Add(model);//이 위치가 맞는 것일까 GameObject newObj = Instantiate(slotObject); newObj.transform.SetParent(this.agentScrollTarget); AgentAllocateSlot script = newObj.GetComponent <AgentAllocateSlot>(); script.SetModel(model); script.SetInitialTransform(); model.calcLevel(); script.SetPos(-currentPosy); script.Init(); currentPosy += (script.GetHeight() + verticalSpacing); currentSlotList.Add(script); this.SetScrollRect(currentPosy); }