Ejemplo n.º 1
0
    private IEnumerator InitPortalStatusImpl(Action onComplete)
    {
        LoadingQueue loadQueue = new LoadingQueue(this);
        UIntKeyTable <LoadObject> loadTextures = new UIntKeyTable <LoadObject>();

        for (int k = 0; k < locations.Length; k++)
        {
            FieldMapTable.FieldMapTableData tableData = locations[k].tableData;
            if (tableData != null && tableData.hasChildRegion && loadTextures.Get(tableData.iconId) == null)
            {
                loadTextures.Add(tableData.iconId, loadQueue.Load(RESOURCE_CATEGORY.DUNGEON_ICON, ResourceName.GetDungeonIcon(tableData.iconId), false));
            }
        }
        if (loadQueue.IsLoading())
        {
            yield return((object)loadQueue.Wait());
        }
        for (int j = 0; j < locations.Length; j++)
        {
            FieldMapTable.FieldMapTableData tableData2 = locations[j].tableData;
            if (tableData2 != null && tableData2.hasChildRegion)
            {
                locations[j].icon = (loadTextures.Get(tableData2.iconId).loadedObject as Texture2D);
            }
        }
        for (int i = 0; i < portals.Length; i++)
        {
            RegionMapPortal portal = portals[i];
            if (portal.IsVisited())
            {
                portal.Open();
            }
        }
        onComplete?.Invoke();
    }
Ejemplo n.º 2
0
 public List <EnemyPopTableData> GetEnemyPopList(uint map_id)
 {
     if (!Singleton <FieldMapTable> .IsValid())
     {
         return(null);
     }
     return(enemyPopTable.Get(map_id));
 }
Ejemplo n.º 3
0
 public AvatarData GetData(int index)
 {
     if (avatarTable == null || avatarTable.GetCount() <= index)
     {
         return(null);
     }
     return(avatarTable.Get((uint)index));
 }
Ejemplo n.º 4
0
 public PortalTableData GetPortalData(uint id)
 {
     if (!Singleton <FieldMapTable> .IsValid())
     {
         return(null);
     }
     return(portalTable.Get(id));
 }
 public Data GetData(uint id)
 {
     if (audioSettingTable == null)
     {
         return(null);
     }
     return(audioSettingTable.Get(id));
 }
Ejemplo n.º 6
0
    public ItemData GetItemData(uint id)
    {
        if (itemTable == null)
        {
            return(null);
        }
        ItemData itemData = itemTable.Get(id);

        if (itemData == null)
        {
            Log.TableError(this, id);
            itemData      = new ItemData();
            itemData.name = Log.NON_DATA_NAME;
        }
        return(itemData);
    }
Ejemplo n.º 7
0
    public static string Format(STRING_CATEGORY category, uint id, params object[] args)
    {
        if (!Singleton <StringTable> .IsValid())
        {
            return("ERR::STRING_NOT_FOUND");
        }
        StringTable           i            = Singleton <StringTable> .I;
        UIntKeyTable <string> uIntKeyTable = i.stringKeyTable.Get(category.ToString());

        if (uIntKeyTable == null)
        {
            return("ERR::STRING_NOT_FOUND");
        }
        string text = uIntKeyTable.Get(id);

        if (text == null)
        {
            return("ERR::STRING_NOT_FOUND");
        }
        if (args == null)
        {
            return(text);
        }
        return(string.Format(text, args));
    }
Ejemplo n.º 8
0
    public static bool AddUIntKeyListTable <T>(UIntKeyTable <List <T> > table, string text, CallBackUIntKeyReadCSV <T> cb, string name_table) where T : new()
    {
        CSVReader cSVReader = new CSVReader(text, name_table, false);

        while (cSVReader.NextLine())
        {
            string value = string.Empty;
            if ((bool)cSVReader.Pop(ref value) && value.Length > 0)
            {
                uint key = uint.Parse(value);
                T    val = new T();
                if (!cb(cSVReader, val, ref key))
                {
                    return(false);
                }
                List <T> list = table.Get(key);
                if (list == null)
                {
                    list = new List <T>();
                    table.Add(key, list);
                }
                list.Add(val);
            }
        }
        return(true);
    }
Ejemplo n.º 9
0
    public override bool Equals(object obj)
    {
        if (obj == null)
        {
            return(false);
        }
        UIntKeyTable <T> rhs = obj as UIntKeyTable <T>;

        if (rhs == null)
        {
            return(false);
        }
        if (GetCount() != rhs.GetCount())
        {
            return(false);
        }
        bool isEqual = true;

        ForEachKeyValue(delegate(uint key, T value1)
        {
            T val   = rhs.Get(key);
            isEqual = (isEqual && value1.Equals(val));
        });
        return(isEqual);
    }
Ejemplo n.º 10
0
 public List <GatherPointTableData> GetGatherPointListByMapID(uint map_id)
 {
     if (!Singleton <FieldMapTable> .IsValid())
     {
         return(null);
     }
     return(gatherPointMapIDTable.Get(map_id));
 }
 public CreateEquipItemData GetCreateEquipItemTableData(uint id)
 {
     if (tableData == null)
     {
         return(null);
     }
     return(tableData.Get(id));
 }
Ejemplo n.º 12
0
 public Data GetSeData(uint id)
 {
     if (seTable == null)
     {
         return(null);
     }
     return(seTable.Get(id));
 }
Ejemplo n.º 13
0
 public GatherPointViewTableData GetGatherPointViewData(uint id)
 {
     if (!Singleton <FieldMapTable> .IsValid())
     {
         return(null);
     }
     return(gatherPointViewTable.Get(id));
 }
Ejemplo n.º 14
0
 public List <FieldGimmickPointTableData> GetFieldGimmickPointListByMapID(uint mapID)
 {
     if (!Singleton <FieldMapTable> .IsValid())
     {
         return(null);
     }
     return(fieldGimmickPointMapIDTable.Get(mapID));
 }
Ejemplo n.º 15
0
 public PlaceableObjectData GetPlaceableObjectData(uint id)
 {
     if (objectTable == null)
     {
         return(null);
     }
     return(objectTable.Get(id));
 }
Ejemplo n.º 16
0
 public OpponentRecord Find(StageObject obj)
 {
     if (obj == null)
     {
         return(null);
     }
     return(opponentRecords.Get((uint)obj.id));
 }
Ejemplo n.º 17
0
 public MissionTableData GetMissionData(uint id)
 {
     if (!Singleton <QuestTable> .IsValid())
     {
         return(null);
     }
     return(missionTable.Get(id));
 }
Ejemplo n.º 18
0
 public FieldBuffData GetData(uint id)
 {
     if (dataTable == null)
     {
         return(null);
     }
     return(dataTable.Get(id));
 }
Ejemplo n.º 19
0
 public Data GetData(uint id)
 {
     if (!Singleton <RegionTable> .IsValid())
     {
         return(null);
     }
     return(table.Get(id));
 }
 public Data GetData(uint id)
 {
     if (table == null)
     {
         return(null);
     }
     return(table.Get(id));
 }
Ejemplo n.º 21
0
 public FieldGimmickActionTableData GetFieldGimmickActionData(uint id)
 {
     if (!Singleton <FieldMapTable> .IsValid())
     {
         return(null);
     }
     return(fieldGimmickActionTable.Get(id));
 }
Ejemplo n.º 22
0
 public PlaceableMapData GetPlaceableMapData(uint id)
 {
     if (mapTable == null)
     {
         return(null);
     }
     return(mapTable.Get(id));
 }
Ejemplo n.º 23
0
    public GrowEnemyData GetGrowEnemyData(uint growId, int level)
    {
        if (growTableData == null)
        {
            Log.Warning("GetGrowEnemyData: growTableDate is null!");
            return(_defaultData);
        }
        UIntKeyTable <GrowEnemyData> uIntKeyTable = growTableData.Get(growId);

        if (uIntKeyTable == null)
        {
            Log.Warning("GetGrowEnemyData: growId {0} is not found!", growId);
            return(_defaultData);
        }
        GrowEnemyData growEnemyData = uIntKeyTable.Get((uint)level);

        if (growEnemyData != null)
        {
            return(growEnemyData);
        }
        GrowEnemyData prev = null;
        GrowEnemyData next = null;

        uIntKeyTable.ForEach(delegate(GrowEnemyData grow)
        {
            if ((int)grow.level < level && (prev == null || (int)grow.level > (int)prev.level))
            {
                prev = grow;
            }
            if ((int)grow.level > level && (next == null || (int)grow.level < (int)next.level))
            {
                next = grow;
            }
        });
        if (next == null || prev == null)
        {
            if (next != null)
            {
                return(next);
            }
            if (prev != null)
            {
                return(prev);
            }
            Log.Warning("GetGrowEnemyData: growId {0}, Lv {1} Lerp error", growId, level);
            return(_defaultData);
        }
        float num = (float)(level - (int)prev.level) / (float)((int)next.level - (int)prev.level);

        growEnemyData        = new GrowEnemyData();
        growEnemyData.growId = growId;
        growEnemyData.level  = level;
        growEnemyData.hp     = Mathf.FloorToInt(Mathf.Lerp((float)(int)prev.hp, (float)(int)next.hp, num));
        growEnemyData.atk    = Mathf.FloorToInt(Mathf.Lerp((float)(int)prev.atk, (float)(int)next.atk, num));
        return(growEnemyData);
    }
Ejemplo n.º 24
0
 public FieldGimmickPointTableData GetFieldGimmickPointData(uint id)
 {
     if (!Singleton <FieldMapTable> .IsValid())
     {
         return(null);
     }
     if (fieldGimmickPointTable == null || fieldGimmickPointTable.GetCount() == 0)
     {
         return(null);
     }
     return(fieldGimmickPointTable.Get(id));
 }
Ejemplo n.º 25
0
    public static void ChangeLightShader(Transform root)
    {
        //IL_0058: Unknown result type (might be due to invalid IL or missing references)
        //IL_0092: Unknown result type (might be due to invalid IL or missing references)
        //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
        //IL_00d6: Expected O, but got Unknown
        UIntKeyTable <Material> uIntKeyTable = new UIntKeyTable <Material>();
        List <Renderer>         list         = new List <Renderer>();

        root.GetComponentsInChildren <Renderer>(true, list);
        int i = 0;

        for (int count = list.Count; i < count; i++)
        {
            Renderer   val             = list[i];
            Material[] sharedMaterials = val.get_sharedMaterials();
            int        j = 0;
            for (int num = sharedMaterials.Length; j < num; j++)
            {
                Material val2 = sharedMaterials[j];
                if (val2 != null && val2.get_shader() != null)
                {
                    Material val3 = uIntKeyTable.Get((uint)val2.GetInstanceID());
                    if (val3 != null)
                    {
                        sharedMaterials[j] = val3;
                    }
                    else
                    {
                        string name = val2.get_shader().get_name();
                        if (!name.EndsWith("__l"))
                        {
                            Shader val4 = ResourceUtility.FindShader(name + "__l");
                            if (val4 != null)
                            {
                                val3 = new Material(val2);
                                val3.set_shader(val4);
                                sharedMaterials[j] = val3;
                                uIntKeyTable.Add((uint)val2.GetInstanceID(), val3);
                                continue;
                            }
                        }
                        uIntKeyTable.Add((uint)val2.GetInstanceID(), val2);
                    }
                }
            }
            val.set_sharedMaterials(sharedMaterials);
        }
        uIntKeyTable.Clear();
        list.Clear();
    }
Ejemplo n.º 26
0
    public List <PortalTableData> GetPortalListByMapID(uint map_id, bool do_sort = false)
    {
        if (!Singleton <FieldMapTable> .IsValid())
        {
            return(null);
        }
        List <PortalTableData> list = portalSrcMapIDTable.Get(map_id);

        if (list != null && do_sort)
        {
            list.Sort((PortalTableData l, PortalTableData r) => (int)(l.openPriority - r.openPriority));
        }
        return(list);
    }
Ejemplo n.º 27
0
    public TaskData Get(uint id)
    {
        if (taskDataTable == null)
        {
            return(null);
        }
        TaskData taskData = taskDataTable.Get(id);

        if (taskData == null)
        {
            Log.TableError(this, id);
            return(null);
        }
        return(taskData);
    }
Ejemplo n.º 28
0
    public static string GetErrorCodeText(uint id)
    {
        if (!Singleton <StringTable> .IsValid())
        {
            return("ERR::STRING_NOT_FOUND");
        }
        StringTable           i            = Singleton <StringTable> .I;
        UIntKeyTable <string> uIntKeyTable = i.stringKeyTable.Get("ERROR_DIALOG");

        if (uIntKeyTable == null)
        {
            return(GetErrorCodeText(0u));
        }
        return(uIntKeyTable.Get(id));
    }
Ejemplo n.º 29
0
    public CreatePickupItemData GetLevelTable(uint id)
    {
        if (pickupTable == null)
        {
            return(null);
        }
        CreatePickupItemData createPickupItemData = pickupTable.Get(id);

        if (createPickupItemData == null)
        {
            Log.Error("CreatePickupItemData is NULL :: id(Lv) = " + id);
            return(null);
        }
        return(createPickupItemData);
    }
 private void RemoveResendPacket(CoopPacket packet)
 {
     if (packet.packetType == PACKET_TYPE.ACK || packet.packetType == PACKET_TYPE.REGISTER_ACK || packet.packetType == PACKET_TYPE.PARTY_REGISTER_ACK || packet.packetType == PACKET_TYPE.LOUNGE_REGISTER_ACK)
     {
         Coop_Model_ACK coop_Model_ACK = packet.model as Coop_Model_ACK;
         if (coop_Model_ACK != null)
         {
             ResendPacket resendPacket = resendPackets.Get((uint)coop_Model_ACK.ack);
             if (resendPacket != null)
             {
                 bool flag = coop_Model_ACK.positive;
                 if (resendPacket.onReceiveAck != null)
                 {
                     flag = resendPacket.onReceiveAck(coop_Model_ACK);
                 }
                 if (flag)
                 {
                     LogDebug("Remove a packet from the resending queue: packet={0}, ack={1}", resendPacket.packet, coop_Model_ACK.ack);
                     resendPackets.Remove((uint)coop_Model_ACK.ack);
                 }
             }
         }
     }
 }