Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
    public void SetAllocateIndex(AgentModel model, int i)
    {
        AgentAllocateSlot slot = GetSlot(model);

        if (slot != null)
        {
            slot.SetAllocatedIndex(i);
        }
    }
Ejemplo n.º 3
0
    public AgentAllocateSlot GetSlot(AgentModel target)
    {
        AgentAllocateSlot slot = null;

        foreach (AgentAllocateSlot s in this.currentSlotList)
        {
            if (s.CheckAgent(target))
            {
                slot = s;
                break;
            }
        }
        return(slot);
    }
Ejemplo n.º 4
0
    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));
            }
        }
    }
Ejemplo n.º 5
0
    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);
    }