Beispiel #1
0
    public static void LoadBank(string name)
    {
        AkBankHandle handle = null;

        if (!m_BankHandles.TryGetValue(name, out handle))
        {
            handle = new AkBankHandle(name);
            m_BankHandles.Add(name, handle);
            handle.LoadBank();
        }
    }
 public void AddToResourceMap(DictionaryView <string, ListView <CResourcePackerInfo> > map)
 {
     for (int i = 0; i < this.m_resourceInfos.Count; i++)
     {
         stResourceInfo info  = this.m_resourceInfos[i];
         string         key   = info.m_fullPathInResourcesWithoutExtension.ToLower();
         stResourceInfo info2 = this.m_resourceInfos[i];
         if (info2.m_isRenamed)
         {
             if (this.m_renameMap == null)
             {
                 this.m_renameMap = new Dictionary <string, string>();
             }
             stResourceInfo info3 = this.m_resourceInfos[i];
             this.m_renameMap.Add(key, info3.m_fullPathInResourcesWithoutExtension_Renamed.ToLower());
         }
         ListView <CResourcePackerInfo> view = null;
         if (!map.TryGetValue(key, out view))
         {
             view = new ListView <CResourcePackerInfo>();
             map.Add(key, view);
         }
         view.Add(this);
     }
 }
Beispiel #3
0
        public void AddCommand(ICheatCommand InCommand, int HierarchiesIndex)
        {
            DebugHelper.Assert(InCommand != null);
            string[] GroupHierarchies = InCommand.command.groupHierarchies;

            DebugHelper.Assert(GroupHierarchies != null);

            if (HierarchiesIndex < GroupHierarchies.Length)
            {
                // should add to children group
                CheatCommandGroup Groups = null;
                if (!ChildrenGroups.TryGetValue(GroupHierarchies[HierarchiesIndex], out Groups))
                {
                    Groups = new CheatCommandGroup();
                    ChildrenGroups.Add(GroupHierarchies[HierarchiesIndex], Groups);
                }

                DebugHelper.Assert(Groups != null);

                Groups.AddCommand(InCommand, HierarchiesIndex + 1);
            }
            else
            {
                // add to this group
                Commands.Add(InCommand.command.baseName, InCommand);
            }
        }
Beispiel #4
0
 private void AddAction(DictionaryView <string, Action> actions, string actionName)
 {
     if (actionName != null && !this.actionDict.ContainsKey(actionName) && !actions.ContainsKey(actionName))
     {
         actions.Add(actionName, null);
     }
 }
Beispiel #5
0
    public static void LoadBank(string name)
    {
        m_Mutex.WaitOne();
        AkBankHandle handle = null;

        if (!m_BankHandles.TryGetValue(name, out handle))
        {
            handle = new AkBankHandle(name);
            m_BankHandles.Add(name, handle);
            m_Mutex.ReleaseMutex();
            handle.LoadBank();
        }
        else
        {
            m_Mutex.ReleaseMutex();
        }
    }
    private void AddReferencedAssets(DictionaryView <string, AGE.Action> actions, Dictionary <object, AssetRefType> actionAssets)
    {
        Dictionary <object, AssetRefType> .Enumerator enumerator = actionAssets.GetEnumerator();
        while (enumerator.MoveNext())
        {
            KeyValuePair <object, AssetRefType> current = enumerator.Current;
            AssetRefType type = current.Value;
            switch (type)
            {
            case AssetRefType.Action:
            {
                KeyValuePair <object, AssetRefType> pair2 = enumerator.Current;
                string key = pair2.Key as string;
                if (!this.actionDict.ContainsKey(key) && !actions.ContainsKey(key))
                {
                    actions.Add(key, null);
                }
                continue;
            }

            case AssetRefType.SkillID:
            {
                KeyValuePair <object, AssetRefType> pair5 = enumerator.Current;
                int skillID = (int)pair5.Key;
                this.AddActionsFromSkill(actions, skillID);
                continue;
            }

            case AssetRefType.SkillCombine:
            {
                KeyValuePair <object, AssetRefType> pair4 = enumerator.Current;
                int skillCombineID = (int)pair4.Key;
                this.AddActionsFromSkillCombine(actions, skillCombineID);
                continue;
            }

            case AssetRefType.Prefab:
            case AssetRefType.Particle:
            {
                KeyValuePair <object, AssetRefType> pair3 = enumerator.Current;
                string str2 = pair3.Key as string;
                if (!this.prefabDict.ContainsKey(str2))
                {
                    this.prefabDict.Add(str2, type == AssetRefType.Particle);
                }
                continue;
            }

            case AssetRefType.MonsterConfigId:
            {
                KeyValuePair <object, AssetRefType> pair6 = enumerator.Current;
                int num3 = (int)pair6.Key;
                this.AddActionsFromSoldier(actions, (uint)num3);
                continue;
            }
            }
        }
    }
Beispiel #7
0
    private void AddAction(DictionaryView <string, Action> actions, byte[] actionNameUtf8)
    {
        string text = StringHelper.UTF8BytesToString(ref actionNameUtf8);

        if (text != null && !this.actionDict.ContainsKey(text) && !actions.ContainsKey(text))
        {
            actions.Add(text, null);
        }
    }
    private void AddAction(DictionaryView <string, AGE.Action> actions, byte[] actionNameUtf8)
    {
        string key = StringHelper.UTF8BytesToString(ref actionNameUtf8);

        if (((key != null) && !this.actionDict.ContainsKey(key)) && !actions.ContainsKey(key))
        {
            actions.Add(key, null);
        }
    }
 protected virtual void Update()
 {
     if (_hasRenderer)
     {
         _hasRenderer = false;
         if (_toClean.Count > 0)
         {
             for (int j = 0; j < _toClean.Count; j++)
             {
                 Mesh mesh = _toClean[j];
                 if (mesh != null)
                 {
                     if (Application.isEditor)
                     {
                         UnityEngine.Object.DestroyImmediate(mesh, true);
                     }
                     else
                     {
                         UnityEngine.Object.Destroy(mesh);
                     }
                 }
             }
         }
         _toClean.Clear();
     }
     if (!_matToTrailList.ContainsKey(this.TrailData.TrailMaterial))
     {
         _matToTrailList.Add(this.TrailData.TrailMaterial, new ListView <PCTrail>());
     }
     if (this._activeTrail != null)
     {
         this.UpdatePoints(this._activeTrail, Time.deltaTime);
         this.UpdateTrail(this._activeTrail, Time.deltaTime);
         this.GenerateMesh(this._activeTrail);
         _matToTrailList[this.TrailData.TrailMaterial].Add(this._activeTrail);
     }
     for (int i = this._fadingTrails.Count - 1; i >= 0; i--)
     {
         if ((this._fadingTrails[i] == null) || !this.AnyElement(this._fadingTrails[i].Points))
         {
             if (this._fadingTrails[i] != null)
             {
                 this._fadingTrails[i].Dispose();
             }
             this._fadingTrails.RemoveAt(i);
         }
         else
         {
             this.UpdatePoints(this._fadingTrails[i], Time.deltaTime);
             this.UpdateTrail(this._fadingTrails[i], Time.deltaTime);
             this.GenerateMesh(this._fadingTrails[i]);
             _matToTrailList[this.TrailData.TrailMaterial].Add(this._fadingTrails[i]);
         }
     }
     this.CheckEmitChange();
 }
Beispiel #10
0
        private static object FromStringStruct(System.Type type, string src)
        {
            object obj2 = Activator.CreateInstance(type);
            DictionaryView <string, FieldInfo> view = new DictionaryView <string, FieldInfo>();

            foreach (FieldInfo info in type.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly))
            {
                if (!info.IsLiteral)
                {
                    view.Add(info.Name, info);
                }
            }
            if (!string.IsNullOrEmpty(src))
            {
                int num2       = SkipPairedBrackets(src, 0);
                int startIndex = 1;
                int index      = src.IndexOf(';', startIndex);
                while (index != -1)
                {
                    if (index > startIndex)
                    {
                        string str2;
                        int    num5   = src.IndexOf('=', startIndex);
                        int    length = num5 - startIndex;
                        string key    = src.Substring(startIndex, length);
                        char   ch     = src[num5 + 1];
                        if (ch != '{')
                        {
                            length = (index - num5) - 1;
                            str2   = src.Substring(num5 + 1, length);
                        }
                        else
                        {
                            int indexBracketBegin = 0;
                            indexBracketBegin += num5 + 1;
                            length             = (SkipPairedBrackets(src, indexBracketBegin) - indexBracketBegin) + 1;
                            str2  = src.Substring(num5 + 1, length);
                            index = (num5 + 1) + length;
                        }
                        if (view.ContainsKey(key))
                        {
                            FieldInfo info2 = view[key];
                            object    obj3  = FromString(info2.FieldType, str2, false);
                            info2.SetValue(obj2, obj3);
                        }
                    }
                    startIndex = index + 1;
                    index      = src.IndexOf(';', startIndex);
                    if (index > num2)
                    {
                        return(obj2);
                    }
                }
            }
            return(obj2);
        }
Beispiel #11
0
 public void InsertEventGlobal(string className, CNamedEvent pEvent)
 {
     if (this.FindEventStatic(className, pEvent.GetName()) == null)
     {
         if (!this.ms_eventInfosGlobal.ContainsKey(className))
         {
             this.ms_eventInfosGlobal.Add(className, new DictionaryView <CStringID, CNamedEvent>());
         }
         DictionaryView <CStringID, CNamedEvent> view = this.ms_eventInfosGlobal[className];
         CNamedEvent event3 = (CNamedEvent)pEvent.clone();
         CStringID   key    = new CStringID(event3.GetName());
         view.Add(key, event3);
     }
 }
 public void CopyRefParams(Action resource)
 {
     this.refParamsSrc = resource.refParams;
     this.refParams.ClearParams();
     DictionaryView <string, SRefParam> .Enumerator enumerator = this.refParamsSrc.refParamList.GetEnumerator();
     while (enumerator.MoveNext())
     {
         DictionaryView <string, SRefParam> refParamList = this.refParams.refParamList;
         KeyValuePair <string, SRefParam>   current      = enumerator.Current;
         string key = current.get_Key();
         KeyValuePair <string, SRefParam> current2 = enumerator.Current;
         refParamList.Add(key, current2.get_Value().Clone());
     }
 }
Beispiel #13
0
 public void InsertEventGlobal(string className, CNamedEvent pEvent)
 {
     if (this.FindEventStatic(className, pEvent.GetName()) == null)
     {
         if (!this.ms_eventInfosGlobal.ContainsKey(className))
         {
             this.ms_eventInfosGlobal.Add(className, new DictionaryView <CStringID, CNamedEvent>());
         }
         DictionaryView <CStringID, CNamedEvent> dictionaryView = this.ms_eventInfosGlobal.get_Item(className);
         CNamedEvent cNamedEvent = (CNamedEvent)pEvent.clone();
         CStringID   cStringID   = new CStringID(cNamedEvent.GetName());
         dictionaryView.Add(cStringID, cNamedEvent);
     }
 }
 public void AddToResourceMap(DictionaryView <string, ListView <CResourcePackerInfo> > map)
 {
     for (int i = 0; i < this.m_resourceInfos.Count; i++)
     {
         stResourceInfo info = this.m_resourceInfos[i];
         string         key  = info.m_fullPathInResourcesWithoutExtension.ToLower();
         ListView <CResourcePackerInfo> view = null;
         if (!map.TryGetValue(key, out view))
         {
             view = new ListView <CResourcePackerInfo>();
             map.Add(key, view);
         }
         view.Add(this);
     }
 }
Beispiel #15
0
 protected DictionaryView<TriggerActionBase, RefParamOperator> DoActorEnterShared(ref PoolObjHandle<ActorRoot> inActor)
 {
     DictionaryView<TriggerActionBase, RefParamOperator> view = new DictionaryView<TriggerActionBase, RefParamOperator>();
     foreach (TriggerActionWrapper wrapper in this.m_internalActList)
     {
         if (wrapper != null)
         {
             RefParamOperator @operator = wrapper.TriggerEnter(inActor, this.thisActor, this, null);
             if (@operator != null)
             {
                 view.Add(wrapper.GetActionInternal(), @operator);
             }
         }
     }
     return view;
 }
Beispiel #16
0
 private void OnEnable()
 {
     if (this.multiPositionTypeLabel == MultiPositionTypeLabel.Simple_Mode)
     {
         AkGameObj[] components = base.gameObject.GetComponents <AkGameObj>();
         for (int i = 0; i < components.Length; i++)
         {
             components[i].enabled = true;
         }
     }
     else if (this.multiPositionTypeLabel == MultiPositionTypeLabel.Large_Mode)
     {
         AkGameObj[] objArray2 = base.gameObject.GetComponents <AkGameObj>();
         for (int j = 0; j < objArray2.Length; j++)
         {
             objArray2[j].enabled = false;
         }
         AkPositionArray array = this.BuildAkPositionArray();
         AkSoundEngine.SetMultiplePositions(base.gameObject, array, (ushort)array.Count, MultiPositionType.MultiPositionType_MultiSources);
     }
     else if (this.multiPositionTypeLabel == MultiPositionTypeLabel.MultiPosition_Mode)
     {
         AkMultiPosEvent event2;
         AkGameObj[]     objArray3 = base.gameObject.GetComponents <AkGameObj>();
         for (int k = 0; k < objArray3.Length; k++)
         {
             objArray3[k].enabled = false;
         }
         if (multiPosEventTree.TryGetValue(base.eventID, out event2))
         {
             if (!event2.list.Contains(this))
             {
                 event2.list.Add(this);
             }
         }
         else
         {
             event2 = new AkMultiPosEvent();
             event2.list.Add(this);
             multiPosEventTree.Add(base.eventID, event2);
         }
         AkPositionArray array2 = this.BuildMultiDirectionArray(ref event2);
         AkSoundEngine.SetMultiplePositions(event2.list[0].gameObject, array2, (ushort)array2.Count, MultiPositionType.MultiPositionType_MultiSources);
     }
 }
        protected DictionaryView <TriggerActionBase, RefParamOperator> DoActorEnterShared(ref PoolObjHandle <ActorRoot> inActor)
        {
            DictionaryView <TriggerActionBase, RefParamOperator> dictionaryView = new DictionaryView <TriggerActionBase, RefParamOperator>();

            TriggerActionWrapper[] internalActList = this.m_internalActList;
            for (int i = 0; i < internalActList.Length; i++)
            {
                TriggerActionWrapper triggerActionWrapper = internalActList[i];
                if (triggerActionWrapper != null)
                {
                    RefParamOperator refParamOperator = triggerActionWrapper.TriggerEnter(inActor, this.thisActor, this);
                    if (refParamOperator != null)
                    {
                        dictionaryView.Add(triggerActionWrapper.GetActionInternal(), refParamOperator);
                    }
                }
            }
            return(dictionaryView);
        }
Beispiel #18
0
 public static void InitHeroSkinDicData()
 {
     s_heroSkinDic.Clear();
     Dictionary <long, object> .Enumerator enumerator = GameDataMgr.heroSkinDatabin.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <long, object> current = enumerator.Current;
         ResHeroSkin item = current.Value as ResHeroSkin;
         if (((item != null) && (item.bIsShow != 0)) && (GameDataMgr.heroDatabin.GetDataByKey(item.dwHeroID) != null))
         {
             if (!s_heroSkinDic.ContainsKey(item.dwHeroID))
             {
                 ListView <ResHeroSkin> view = new ListView <ResHeroSkin>();
                 s_heroSkinDic.Add(item.dwHeroID, view);
             }
             s_heroSkinDic[item.dwHeroID].Add(item);
         }
     }
 }
Beispiel #19
0
        public static ListView <UrlAction> ParseFromText(string text, char[] spliter = null)
        {
            ListView <UrlAction> view = new ListView <UrlAction>();

            if (spliter == null)
            {
                spliter = MultiSpliter;
            }
            try
            {
                string[] strArray = text.Split(spliter, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < strArray.Length; i++)
                {
                    string[] strArray2 = strArray[i].Split(InnerSpliter, StringSplitOptions.RemoveEmptyEntries);
                    if (strArray2.Length > 0)
                    {
                        DictionaryView <string, string> view2 = new DictionaryView <string, string>();
                        for (int j = 1; j < strArray2.Length; j++)
                        {
                            string[] strArray3 = strArray2[j].Split(ParamSpliter);
                            if ((strArray3 != null) && (strArray3.Length == 2))
                            {
                                view2.Add(strArray3[0], strArray3[1]);
                            }
                        }
                        UrlAction item = new UrlAction {
                            target = strArray2[0],
                            action = Action.none
                        };
                        if (view2.ContainsKey("action"))
                        {
                            string key = view2["action"];
                            if (key != null)
                            {
                                int num3;
                                if (< > f__switch$map2 == null)
                                {
                                    Dictionary <string, int> dictionary = new Dictionary <string, int>(3);
                                    dictionary.Add("openUrl", 0);
                                    dictionary.Add("openForm", 1);
                                    dictionary.Add("buy", 2);
                                    < > f__switch$map2 = dictionary;
                                }
Beispiel #20
0
        public static ListView <UrlAction> ParseFromText(string text, char[] spliter = null)
        {
            ListView <UrlAction> listView = new ListView <UrlAction>();

            if (spliter == null)
            {
                spliter = UrlAction.MultiSpliter;
            }
            try
            {
                string[] array = text.Split(spliter, 1);
                for (int i = 0; i < array.Length; i++)
                {
                    string[] array2 = array[i].Split(UrlAction.InnerSpliter, 1);
                    if (array2.Length > 0)
                    {
                        DictionaryView <string, string> dictionaryView = new DictionaryView <string, string>();
                        for (int j = 1; j < array2.Length; j++)
                        {
                            string[] array3 = array2[j].Split(UrlAction.ParamSpliter);
                            if (array3 != null && array3.Length == 2)
                            {
                                dictionaryView.Add(array3[0], array3[1]);
                            }
                        }
                        UrlAction urlAction = new UrlAction();
                        urlAction.target = array2[0];
                        urlAction.action = UrlAction.Action.none;
                        if (dictionaryView.ContainsKey("action"))
                        {
                            string text2 = dictionaryView["action"];
                            string text3 = text2;
                            string text4 = text3;
                            if (text4 != null)
                            {
                                if (UrlAction.< > f__switch$map2 == null)
                                {
                                    Dictionary <string, int> dictionary = new Dictionary <string, int>(4);
                                    dictionary.Add("openUrl", 0);
                                    dictionary.Add("openForm", 1);
                                    dictionary.Add("buy", 2);
                                    dictionary.Add("openMatchUrl", 3);
                                    UrlAction.< > f__switch$map2 = dictionary;
                                }
                                int num;
                                if (UrlAction.< > f__switch$map2.TryGetValue(text4, ref num))
                                {
                                    switch (num)
                                    {
                                    case 0:
                                        urlAction.action = UrlAction.Action.openUrl;
                                        urlAction.url    = dictionaryView["url"];
                                        break;

                                    case 1:
                                        urlAction.action = UrlAction.Action.openForm;
                                        urlAction.form   = (RES_GAME_ENTRANCE_TYPE)int.Parse(dictionaryView["form"]);
                                        break;

                                    case 2:
                                        urlAction.action   = UrlAction.Action.buy;
                                        urlAction.prodType = (COM_ITEM_TYPE)int.Parse(dictionaryView["prodType"]);
                                        urlAction.prodID   = uint.Parse(dictionaryView["prodID"]);
                                        if (dictionaryView.ContainsKey("prodSpec"))
                                        {
                                            int.TryParse(dictionaryView["prodSpec"], ref urlAction.prodSpec);
                                        }
                                        break;

                                    case 3:
                                    {
                                        int num2 = text.IndexOf("#action=openMatchUrl");
                                        if (num2 > 0)
                                        {
                                            urlAction.target = text.Substring(0, num2);
                                        }
                                        urlAction.action = UrlAction.Action.openMatchUrl;
                                        break;
                                    }
                                    }
                                }
                            }
                        }
                        if (dictionaryView.ContainsKey("overTime"))
                        {
                            ulong.TryParse(dictionaryView["overTime"], ref urlAction.overTime);
                        }
                        if (dictionaryView.ContainsKey("showTime"))
                        {
                            int.TryParse(dictionaryView["showTime"], ref urlAction.showTime);
                        }
                        listView.Add(urlAction);
                    }
                }
            }
            catch (Exception var_11_299)
            {
            }
            return(listView);
        }
Beispiel #21
0
        private static object FromStringStruct(Type type, string src)
        {
            object obj = Activator.CreateInstance(type);
            DictionaryView <string, FieldInfo> dictionaryView = new DictionaryView <string, FieldInfo>();

            FieldInfo[] fields = type.GetFields(62);
            for (int i = 0; i < fields.Length; i++)
            {
                FieldInfo fieldInfo = fields[i];
                if (!fieldInfo.get_IsLiteral())
                {
                    dictionaryView.Add(fieldInfo.get_Name(), fieldInfo);
                }
            }
            if (string.IsNullOrEmpty(src))
            {
                return(obj);
            }
            int num  = StringUtils.SkipPairedBrackets(src, 0);
            int num2 = 1;
            int num3 = src.IndexOf(';', num2);

            while (num3 != -1)
            {
                if (num3 > num2)
                {
                    int    num4 = src.IndexOf('=', num2);
                    int    num5 = num4 - num2;
                    string key  = src.Substring(num2, num5);
                    char   c    = src.get_Chars(num4 + 1);
                    string valStr;
                    if (c != '{')
                    {
                        num5   = num3 - num4 - 1;
                        valStr = src.Substring(num4 + 1, num5);
                    }
                    else
                    {
                        int num6 = 0;
                        num6 += num4 + 1;
                        int num7 = StringUtils.SkipPairedBrackets(src, num6);
                        num5   = num7 - num6 + 1;
                        valStr = src.Substring(num4 + 1, num5);
                        num3   = num4 + 1 + num5;
                    }
                    if (dictionaryView.ContainsKey(key))
                    {
                        FieldInfo fieldInfo2 = dictionaryView[key];
                        object    obj2       = StringUtils.FromString(fieldInfo2.get_FieldType(), valStr, false);
                        fieldInfo2.SetValue(obj, obj2);
                    }
                }
                num2 = num3 + 1;
                num3 = src.IndexOf(';', num2);
                if (num3 > num)
                {
                    break;
                }
            }
            return(obj);
        }
Beispiel #22
0
        public static ListView <UrlAction> ParseFromText(string text, char[] spliter = null)
        {
            ListView <UrlAction> listView = new ListView <UrlAction>();

            if (spliter == null)
            {
                spliter = UrlAction.MultiSpliter;
            }
            try
            {
                string[] array = text.Split(spliter, 1);
                for (int i = 0; i < array.Length; i++)
                {
                    string[] array2 = array[i].Split(UrlAction.InnerSpliter, 1);
                    if (array2.Length > 0)
                    {
                        DictionaryView <string, string> dictionaryView = new DictionaryView <string, string>();
                        for (int j = 1; j < array2.Length; j++)
                        {
                            string[] array3 = array2[j].Split(UrlAction.ParamSpliter);
                            if (array3 != null && array3.Length == 2)
                            {
                                dictionaryView.Add(array3[0], array3[1]);
                            }
                        }
                        UrlAction urlAction = new UrlAction();
                        urlAction.target = array2[0];
                        urlAction.action = UrlAction.Action.none;
                        if (dictionaryView.ContainsKey("action"))
                        {
                            string text2 = dictionaryView.get_Item("action");
                            string text3 = text2;
                            if (text3 != null)
                            {
                                if (UrlAction.< > f__switch$map0 == null)
                                {
                                    Dictionary <string, int> dictionary = new Dictionary <string, int>(3);
                                    dictionary.Add("openUrl", 0);
                                    dictionary.Add("openForm", 1);
                                    dictionary.Add("buy", 2);
                                    UrlAction.< > f__switch$map0 = dictionary;
                                }
                                int num;
                                if (UrlAction.< > f__switch$map0.TryGetValue(text3, ref num))
                                {
                                    switch (num)
                                    {
                                    case 0:
                                        urlAction.action = UrlAction.Action.openUrl;
                                        urlAction.url    = dictionaryView.get_Item("url");
                                        break;

                                    case 1:
                                        urlAction.action = UrlAction.Action.openForm;
                                        urlAction.form   = int.Parse(dictionaryView.get_Item("form"));
                                        break;

                                    case 2:
                                        urlAction.action   = UrlAction.Action.buy;
                                        urlAction.prodType = int.Parse(dictionaryView.get_Item("prodType"));
                                        urlAction.prodID   = uint.Parse(dictionaryView.get_Item("prodID"));
                                        if (dictionaryView.ContainsKey("prodSpec"))
                                        {
                                            int.TryParse(dictionaryView.get_Item("prodSpec"), ref urlAction.prodSpec);
                                        }
                                        break;
                                    }
                                }
                            }
                        }
                        if (dictionaryView.ContainsKey("overTime"))
                        {
                            ulong.TryParse(dictionaryView.get_Item("overTime"), ref urlAction.overTime);
                        }
                        if (dictionaryView.ContainsKey("showTime"))
                        {
                            int.TryParse(dictionaryView.get_Item("showTime"), ref urlAction.showTime);
                        }
                        listView.Add(urlAction);
                    }
                }
            }
            catch (Exception var_9_25C)
            {
            }
            return(listView);
        }
Beispiel #23
0
    private void AddReferencedAssets(DictionaryView <string, Action> actions, Dictionary <object, AssetRefType> actionAssets)
    {
        Dictionary <object, AssetRefType> .Enumerator enumerator = actionAssets.GetEnumerator();
        while (enumerator.MoveNext())
        {
            KeyValuePair <object, AssetRefType> current = enumerator.get_Current();
            AssetRefType value = current.get_Value();
            switch (value)
            {
            case AssetRefType.Action:
            {
                KeyValuePair <object, AssetRefType> current2 = enumerator.get_Current();
                string key = current2.get_Key() as string;
                if (!this.actionDict.ContainsKey(key) && !actions.ContainsKey(key))
                {
                    actions.Add(key, null);
                }
                break;
            }

            case AssetRefType.SkillID:
            {
                KeyValuePair <object, AssetRefType> current3 = enumerator.get_Current();
                ulong num     = (ulong)current3.get_Key();
                int   skillID = (int)(num & (ulong)-1);
                this.AddActionsFromSkill(actions, skillID);
                break;
            }

            case AssetRefType.SkillCombine:
            {
                KeyValuePair <object, AssetRefType> current4 = enumerator.get_Current();
                ulong num2           = (ulong)current4.get_Key();
                int   skillCombineID = (int)(num2 & (ulong)-1);
                this.AddActionsFromSkillCombine(actions, skillCombineID);
                break;
            }

            case AssetRefType.Prefab:
            case AssetRefType.Particle:
            {
                KeyValuePair <object, AssetRefType> current5 = enumerator.get_Current();
                string text = current5.get_Key() as string;
                if (!this.prefabDict.ContainsKey(text))
                {
                    this.prefabDict.Add(text, value == AssetRefType.Particle);
                }
                break;
            }

            case AssetRefType.MonsterConfigId:
            {
                KeyValuePair <object, AssetRefType> current6 = enumerator.get_Current();
                ulong num3      = (ulong)current6.get_Key();
                uint  soldierID = (uint)(num3 & (ulong)-1);
                this.AddActionsFromSoldier(actions, soldierID);
                break;
            }
            }
        }
    }
Beispiel #24
0
        private bool Pack(int size)
        {
            int     num  = 0;
            int     num2 = 0;
            int     num3 = 0;
            int     num4 = this.padding;
            Vector2 zero = Vector2.zero;
            DictionaryView <int, AtlasInfo.UVDetail> dictionaryView = new DictionaryView <int, AtlasInfo.UVDetail>();

            DictionaryView <int, AtlasInfo.UVDetail> .Enumerator enumerator = this.textures.GetEnumerator();
            while (enumerator.MoveNext())
            {
                KeyValuePair <int, AtlasInfo.UVDetail> current = enumerator.Current;
                int width = current.get_Value().width;
                KeyValuePair <int, AtlasInfo.UVDetail> current2 = enumerator.Current;
                int height = current2.get_Value().height;
                AtlasInfo.UVDetail uVDetail = new AtlasInfo.UVDetail();
                uVDetail.rotate = false;
                DictionaryView <int, AtlasInfo.UVDetail> dictionaryView2 = dictionaryView;
                KeyValuePair <int, AtlasInfo.UVDetail>   current3        = enumerator.Current;
                dictionaryView2.Add(current3.get_Key(), uVDetail);
                if (num3 + height + num4 <= size && num2 + width + num4 <= size)
                {
                    uVDetail.x      = num2;
                    uVDetail.y      = num3;
                    uVDetail.width  = width;
                    uVDetail.height = height;
                    num3           += height + num4;
                    if (num < num2 + width + num4)
                    {
                        num = num2 + width + num4;
                    }
                }
                else
                {
                    if (num + width > size || height > size)
                    {
                        return(false);
                    }
                    num2            = num;
                    uVDetail.x      = num2;
                    uVDetail.y      = 0;
                    uVDetail.width  = width;
                    uVDetail.height = height;
                    num3            = height + num4;
                    num             = num2 + width + num4;
                }
            }
            TextureFormat textureFormat = TextureFormat.ARGB32;

            if (this.needCompress)
            {
                textureFormat = TextureFormat.ARGB32;
            }
            Texture2D texture2D = new Texture2D(size, size, textureFormat, false);

            Color[] pixels = new Color[texture2D.width * texture2D.height];
            texture2D.SetPixels(pixels);
            texture2D.name = string.Concat(new object[]
            {
                "Auto_UI3D_Atlas_",
                size,
                "_",
                this.counter,
                "_format",
                textureFormat.ToString()
            });
            this.counter++;
            enumerator.Reset();
            while (enumerator.MoveNext())
            {
                Texture2D texture2D2 = null;
                Dictionary <int, Texture2D>            dictionary = this.waitForCombineTextures;
                KeyValuePair <int, AtlasInfo.UVDetail> current4   = enumerator.Current;
                if (!dictionary.TryGetValue(current4.get_Key(), ref texture2D2))
                {
                    texture2D2 = this.atlas;
                }
                KeyValuePair <int, AtlasInfo.UVDetail> current5 = enumerator.Current;
                AtlasInfo.UVDetail value = current5.get_Value();
                DictionaryView <int, AtlasInfo.UVDetail> dictionaryView3 = dictionaryView;
                KeyValuePair <int, AtlasInfo.UVDetail>   current6        = enumerator.Current;
                AtlasInfo.UVDetail uVDetail2 = dictionaryView3[current6.get_Key()];
                Color[]            pixels2   = texture2D2.GetPixels(value.x, value.y, value.width, value.height);
                texture2D.SetPixels(uVDetail2.x, uVDetail2.y, value.width, value.height, pixels2);
                texture2D.Apply(false, false);
                uVDetail2.uvTL = new Vector2((float)uVDetail2.x / (float)texture2D.width, (float)(uVDetail2.y + uVDetail2.height) / (float)texture2D.height);
                uVDetail2.uvTR = new Vector2((float)(uVDetail2.x + uVDetail2.width) / (float)texture2D.width, (float)(uVDetail2.y + uVDetail2.height) / (float)texture2D.height);
                uVDetail2.uvBL = new Vector2((float)uVDetail2.x / (float)texture2D.width, (float)uVDetail2.y / (float)texture2D.height);
                uVDetail2.uvBR = new Vector2((float)(uVDetail2.x + uVDetail2.width) / (float)texture2D.width, (float)uVDetail2.y / (float)texture2D.height);
            }
            this.textures = dictionaryView;
            Object.Destroy(this.atlas);
            this.atlas = texture2D;
            Shader shader = Singleton <CResourceManager> .GetInstance().GetResource("Shaders/UI/UI3D.shader", typeof(Shader), enResourceType.BattleScene, true, true).m_content as Shader;

            this.mat = new Material(shader);
            this.mat.SetTexture("_MainTex", this.atlas);
            HashSet <Sprite3D> .Enumerator enumerator2 = this.sprites.GetEnumerator();
            while (enumerator2.MoveNext())
            {
                enumerator2.get_Current().SetMaterial(this.mat);
                enumerator2.get_Current().SetAutoAtlas(this.atlas, this.textures[enumerator2.get_Current().m_textureGUID]);
            }
            Dictionary <int, Texture2D> .Enumerator enumerator3 = this.waitForCombineTextures.GetEnumerator();
            this.waitForCombineTextures.Clear();
            Singleton <CResourceManager> .GetInstance().UnloadUnusedAssets();

            return(true);
        }