示例#1
0
    public void SetTownEvent(STownEvent townEvent)
    {
        TownEventObjInfo info = WorldManager.instance.m_dataManager.m_townEventObjData.GetTownEventObjTable((uint)townEvent.evCode);

        if (info != null)
        {
            Transform targetTrans = info.positionIndex.Equals(0) ? GetTargetTransform(info.type) : m_dicMissionDummy[info.positionIndex];
            if (targetTrans != null)
            {
                int index = m_eventObjGroup.FindIndex(delegate(TownEventTrigger trigger) {
                    return(!trigger.TriggerActive && trigger.ObjectType.Equals(info.type));
                });

                if (index > -1)
                {
                    m_eventObjGroup[index].Init(info, targetTrans);
                }
                else
                {
                    GameObject obj = Instantiate(m_townEventObjectGroup[(int)info.type]) as GameObject;
                    obj.transform.parent     = m_villageManager.m_panelGroup[(int)GUIManager_Village.PANEL_TYPE.PANEL_S09];
                    obj.transform.localScale = Vector3.one;
                    Util.SetGameObjectLayer(obj, LayerMask.NameToLayer("UIBackground"));

                    TownEventTrigger eventTrigger = obj.GetComponent <TownEventTrigger>();
                    eventTrigger.Init(info, targetTrans);

                    m_eventObjGroup.Add(eventTrigger);
                }
            }
        }
    }
示例#2
0
文件: Town.cs 项目: 1010MMR/Portfolio
 /// <summary>
 /// <para>name : UpdateEvent</para>
 /// <para>describe : 이벤트 패킷 데이터 업데이트.</para>
 /// <para>tag : [email protected]</para>
 /// </summary>
 public void UpdateEvent(STownEvent info)
 {
     if (m_townEventDic.ContainsKey(info.evCode))
     {
         m_townEventDic[info.evCode] = info;
     }
     else
     {
         m_townEventDic.Add(info.evCode, info);
     }
 }