protected virtual bool OnInterpTimedEvent() { int num; string tag = InterpTimedEvent.Tag; if (tag != null) { if (BasicWildLifeAI.< > f__switch$map7 == null) { Dictionary <string, int> strs = new Dictionary <string, int>(2) { { "DEATH", 0 }, { "SOUND", 1 } }; BasicWildLifeAI.< > f__switch$map7 = strs; } if (BasicWildLifeAI.< > f__switch$map7.TryGetValue(tag, out num)) { if (num == 0) { this.DoClientDeath(); return(true); } if (num == 1) { this.PlaySnd(InterpTimedEvent.Argument <int>(0)); return(true); } } } return(false); }
protected bool LoadSettings() { AuthorCreationProject authorCreationProject; string str; int num; bool flag; Stream stream = this.GetStream(true, "dat.asc", out authorCreationProject); if (stream == null) { return(false); } try { using (JSONStream jSONStream = JSONStream.CreateWriter(stream)) { while (jSONStream.Read()) { if (jSONStream.token == JSONToken.ObjectStart) { while (jSONStream.ReadNextProperty(out str)) { string str1 = str; if (str1 == null) { continue; } if (AuthorCreation.< > f__switch$map0 == null) { Dictionary <string, int> strs = new Dictionary <string, int>(2) { { "project", 0 }, { "settings", 1 } }; AuthorCreation.< > f__switch$map0 = strs; } if (!AuthorCreation.< > f__switch$map0.TryGetValue(str1, out num)) { continue; } if (num == 0) { jSONStream.ReadSkip(); } else if (num == 1) { this.LoadSettings(jSONStream); } } } } } flag = true; } finally { stream.Dispose(); } return(flag); }
private int GetCurrentMeshType(string part) { if (part != null) { if (TestChar.< > f__switch$map13 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(4); dictionary.Add("hair", 0); dictionary.Add("pants", 1); dictionary.Add("shoes", 2); dictionary.Add("top", 3); TestChar.< > f__switch$map13 = dictionary; } int num; if (TestChar.< > f__switch$map13.TryGetValue(part, ref num)) { switch (num) { case 0: return(this.currentHairMesh); case 1: return(this.currentPantsMesh); case 2: return(this.currentShoesMesh); case 3: return(this.currentTopMesh); } } } return(1); }
private void Init() { if (this.m_PreviewUtility == null) { this.m_PreviewUtility = new PreviewRenderUtility(); } if (s_Meshes[0] == null) { GameObject obj2 = (GameObject)EditorGUIUtility.LoadRequired("Previews/PreviewMaterials.fbx"); obj2.SetActive(false); IEnumerator enumerator = obj2.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform current = (Transform)enumerator.Current; MeshFilter component = current.GetComponent <MeshFilter>(); string name = current.name; if (name != null) { int num; if (< > f__switch$map1A == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(4); dictionary.Add("sphere", 0); dictionary.Add("cube", 1); dictionary.Add("cylinder", 2); dictionary.Add("torus", 3); < > f__switch$map1A = dictionary; } if (< > f__switch$map1A.TryGetValue(name, out num)) { switch (num) { case 0: { s_Meshes[0] = component.sharedMesh; continue; } case 1: { s_Meshes[1] = component.sharedMesh; continue; } case 2: { s_Meshes[2] = component.sharedMesh; continue; } case 3: { s_Meshes[3] = component.sharedMesh; continue; } } } }
public constants.MobileEnv GetMobileEnvironment() { string text = Login.m_portal.ToLower(); if (text != null) { if (MyClientInterface.< > f__switch$map6 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(6); dictionary.Add("us", 0); dictionary.Add("eu", 0); dictionary.Add("kr", 0); dictionary.Add("cn", 0); dictionary.Add("tw", 0); dictionary.Add("beta", 0); MyClientInterface.< > f__switch$map6 = dictionary; } int num; if (MyClientInterface.< > f__switch$map6.TryGetValue(text, ref num)) { if (num == 0) { return(constants.MobileEnv.PRODUCTION); } } } return(constants.MobileEnv.DEVELOPMENT); }
public constants.MobileEnv GetMobileEnvironment() { int num; string lower = Login.m_portal.ToLower(); if (lower != null) { if (MyClientInterface.< > f__switch$map8 == null) { Dictionary <string, int> strs = new Dictionary <string, int>(7) { { "us", 0 }, { "eu", 0 }, { "kr", 0 }, { "cn", 0 }, { "tw", 0 }, { "beta", 0 }, { "test", 0 } }; MyClientInterface.< > f__switch$map8 = strs; } if (MyClientInterface.< > f__switch$map8.TryGetValue(lower, out num)) { if (num == 0) { return(constants.MobileEnv.PRODUCTION); } } } return(constants.MobileEnv.DEVELOPMENT); }
private int Comparer(T x, T y, PropertyInfo property, bool sortBy) { string text = property.get_PropertyType().ToString(); if (text != null) { if (IListSort <T> .< > f__switch$map18 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(2); dictionary.Add("System.Int32", 0); dictionary.Add("System.String", 1); IListSort <T> .< > f__switch$map18 = dictionary; } int num; if (IListSort <T> .< > f__switch$map18.TryGetValue(text, ref num)) { if (num != 0) { if (num == 1) { string text2 = string.Empty; string text3 = string.Empty; if (property.GetValue(x, null) != null) { text2 = property.GetValue(x, null).ToString(); } if (property.GetValue(y, null) != null) { text3 = property.GetValue(y, null).ToString(); } if (sortBy) { return(text3.CompareTo(text2)); } return(text2.CompareTo(text3)); } } else { int num2 = 0; int num3 = 0; if (property.GetValue(x, null) != null) { num2 = Convert.ToInt32(property.GetValue(x, null)); } if (property.GetValue(y, null) != null) { num3 = Convert.ToInt32(property.GetValue(y, null)); } if (sortBy) { return(num3.CompareTo(num2)); } return(num2.CompareTo(num3)); } } } return(0); }
public UnixBinaryCore(object owner, IDictionary properties, string[] allowedProperties) { int num; this._properties = properties; IDictionaryEnumerator enumerator = properties.GetEnumerator(); try { while (enumerator.MoveNext()) { DictionaryEntry current = (DictionaryEntry)enumerator.Current; string key = (string)current.Key; if (Array.IndexOf <string>(allowedProperties, key) == -1) { throw new RemotingException(string.Concat(owner.GetType().Name, " does not recognize '", key, "' configuration property")); } string str = key; if (str == null) { continue; } if (UnixBinaryCore.< > f__switch$map0 == null) { Dictionary <string, int> strs = new Dictionary <string, int>(2) { { "includeVersions", 0 }, { "strictBinding", 1 } }; UnixBinaryCore.< > f__switch$map0 = strs; } if (!UnixBinaryCore.< > f__switch$map0.TryGetValue(str, out num)) { continue; } if (num == 0) { this._includeVersions = Convert.ToBoolean(current.Value); } else if (num == 1) { this._strictBinding = Convert.ToBoolean(current.Value); } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable == null) { } disposable.Dispose(); } this.Init(); }
private static string ParseTimeUnitsStr(string unitsStr) { int num; if (unitsStr == null) { return("sec"); } unitsStr = unitsStr.ToLowerInvariant(); if (unitsStr != null) { if (TimeUtils.< > f__switch$map2 == null) { Dictionary <string, int> strs = new Dictionary <string, int>(13) { { "s", 0 }, { "sec", 0 }, { "secs", 0 }, { "second", 0 }, { "seconds", 0 }, { "m", 1 }, { "min", 1 }, { "mins", 1 }, { "minute", 1 }, { "minutes", 1 }, { "h", 2 }, { "hour", 2 }, { "hours", 2 } }; TimeUtils.< > f__switch$map2 = strs; } if (TimeUtils.< > f__switch$map2.TryGetValue(unitsStr, out num)) { switch (num) { case 0: { return("sec"); } case 1: { return("min"); } case 2: { return("hour"); } } } } return("sec"); }
void IInterpTimedEventReceiver.OnInterpTimedEvent() { int num; string tag = InterpTimedEvent.Tag; if (tag != null) { if (DeathTransfer.< > f__switch$map3 == null) { Dictionary <string, int> strs = new Dictionary <string, int>(2) { { "ClientLocalDeath", 0 }, { "RAG", 1 } }; DeathTransfer.< > f__switch$map3 = strs; } if (DeathTransfer.< > f__switch$map3.TryGetValue(tag, out num)) { if (num == 0) { try { this.ClientLocalDeath(); } finally { if (!base.localControlled) { UnityEngine.Object.Destroy(base.gameObject); } } return; } else { if (num != 1) { InterpTimedEvent.MarkUnhandled(); return; } try { this.DeathRagdoll(); } finally { UnityEngine.Object.Destroy(base.gameObject); } return; } } } InterpTimedEvent.MarkUnhandled(); }
private void CreateInstruction(JsonReader reader, IXmlDocument document, IXmlNode currentNode, string propertyName) { if (propertyName == "?xml") { string version = null; string encoding = null; string standalone = null; while (reader.Read() && reader.TokenType != JsonToken.EndObject) { string text = reader.Value.ToString(); if (text != null) { if (XmlNodeConverter.< > f__switch$map1 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(3); dictionary.Add("@version", 0); dictionary.Add("@encoding", 1); dictionary.Add("@standalone", 2); XmlNodeConverter.< > f__switch$map1 = dictionary; } int num; if (XmlNodeConverter.< > f__switch$map1.TryGetValue(text, ref num)) { switch (num) { case 0: reader.Read(); version = reader.Value.ToString(); continue; case 1: reader.Read(); encoding = reader.Value.ToString(); continue; case 2: reader.Read(); standalone = reader.Value.ToString(); continue; } } } throw new JsonSerializationException("Unexpected property name encountered while deserializing XmlDeclaration: " + reader.Value); } IXmlNode newChild = document.CreateXmlDeclaration(version, encoding, standalone); currentNode.AppendChild(newChild); } else { IXmlNode newChild2 = document.CreateProcessingInstruction(propertyName.Substring(1), reader.Value.ToString()); currentNode.AppendChild(newChild2); } }
private void ReadReference() { if (this.Peek() != 35) { string text = this.ReadName(); this.Expect(59); string text2 = text; string text3 = text2; if (text3 != null) { if (SmallXmlParser.< > f__switch$map0 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(5); dictionary.Add("amp", 0); dictionary.Add("quot", 1); dictionary.Add("apos", 2); dictionary.Add("lt", 3); dictionary.Add("gt", 4); SmallXmlParser.< > f__switch$map0 = dictionary; } int num; if (SmallXmlParser.< > f__switch$map0.TryGetValue(text3, ref num)) { switch (num) { case 0: this.buffer.Append('&'); return; case 1: this.buffer.Append('"'); return; case 2: this.buffer.Append('\''); return; case 3: this.buffer.Append('<'); return; case 4: this.buffer.Append('>'); return; } } } throw this.Error("General non-predefined entity reference is not supported in this parser."); } this.Read(); this.ReadCharacterReference(); }
protected virtual bool OnInterpTimedEvent() { int num; string tag = InterpTimedEvent.Tag; if (tag != null) { if (RigidObj.< > f__switch$map5 == null) { Dictionary <string, int> strs = new Dictionary <string, int>(2) { { "_init", 0 }, { "_done", 1 } }; RigidObj.< > f__switch$map5 = strs; } if (RigidObj.< > f__switch$map5.TryGetValue(tag, out num)) { if (num == 0) { this.showing = true; if (this.expectsInitialVelocity) { this.rigidbody.isKinematic = false; this.rigidbody.velocity = this.initialVelocity; } return(true); } if (num == 1) { try { this.OnDone(); } finally { try { this.showing = false; } finally { UnityEngine.Object.Destroy(base.gameObject); } } return(true); } } } return(false); }
private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode) { if (propertyName != null) { if (XmlNodeConverter.< > f__switch$map0 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(4); dictionary.Add("#text", 0); dictionary.Add("#cdata-section", 1); dictionary.Add("#whitespace", 2); dictionary.Add("#significant-whitespace", 3); XmlNodeConverter.< > f__switch$map0 = dictionary; } int num; if (XmlNodeConverter.< > f__switch$map0.TryGetValue(propertyName, ref num)) { switch (num) { case 0: currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString())); return; case 1: currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString())); return; case 2: currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString())); return; case 3: currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString())); return; } } } if (!string.IsNullOrEmpty(propertyName) && propertyName.get_Chars(0) == '?') { this.CreateInstruction(reader, document, currentNode, propertyName); } else { if (reader.TokenType == JsonToken.StartArray) { this.ReadArrayElements(reader, document, propertyName, currentNode, manager); return; } this.ReadElement(reader, document, currentNode, propertyName, manager); } }
private void OnClickTab(GameObject go) { string name = go.get_name(); if (name != null) { if (ActorUI.< > f__switch$map15 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(3); dictionary.Add("InfoBtn", 0); dictionary.Add("TitleBtn", 1); dictionary.Add("WingBtn", 2); ActorUI.< > f__switch$map15 = dictionary; } int num; if (ActorUI.< > f__switch$map15.TryGetValue(name, ref num)) { switch (num) { case 0: this.m_RightState = ActorUI.RightState.Property; break; case 1: this.m_RightState = ActorUI.RightState.Title; break; case 2: if (!SystemOpenManager.IsSystemClickOpen(35, 0, true)) { return; } this.m_RightState = ActorUI.RightState.Wing; break; } } } if (this.m_RightState == this.m_LastState) { return; } this.SetBtnLightAndDim(go, "fenleianniu_1", true); if (this.TabBtnDic.ContainsKey(this.m_LastState)) { this.SetBtnLightAndDim(this.TabBtnDic.get_Item(this.m_LastState).get_gameObject(), "fenleianniu_2", false); } this.RefreshRightUIState(this.m_RightState); this.m_LastState = this.m_RightState; }
private static string ParseTimeUnitsStr(string unitsStr) { if (unitsStr == null) { return("sec"); } unitsStr = unitsStr.ToLowerInvariant(); string text = unitsStr; if (text != null) { if (TimeUtils.< > f__switch$mapE == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(13); dictionary.Add("s", 0); dictionary.Add("sec", 0); dictionary.Add("secs", 0); dictionary.Add("second", 0); dictionary.Add("seconds", 0); dictionary.Add("m", 1); dictionary.Add("min", 1); dictionary.Add("mins", 1); dictionary.Add("minute", 1); dictionary.Add("minutes", 1); dictionary.Add("h", 2); dictionary.Add("hour", 2); dictionary.Add("hours", 2); TimeUtils.< > f__switch$mapE = dictionary; } int num; if (TimeUtils.< > f__switch$mapE.TryGetValue(text, ref num)) { switch (num) { case 0: return("sec"); case 1: return("min"); case 2: return("hour"); } } } return("sec"); }
public static string getDayOfWeekJapanese(string dow) { if (dow != null) { if (UIPortFrame.< > f__switch$map11 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(7); dictionary.Add("Sunday", 0); dictionary.Add("Monday", 1); dictionary.Add("Tuesday", 2); dictionary.Add("Wednesday", 3); dictionary.Add("Thursday", 4); dictionary.Add("Friday", 5); dictionary.Add("Saturday", 6); UIPortFrame.< > f__switch$map11 = dictionary; } int num; if (UIPortFrame.< > f__switch$map11.TryGetValue(dow, ref num)) { switch (num) { case 0: return("(日)"); case 1: return("(月)"); case 2: return("(火)"); case 3: return("(水)"); case 4: return("(木)"); case 5: return("(金)"); case 6: return("(土)"); } } } return(string.Empty); }
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; }
protected override void OnRegistered() { int num; string str = base.peiceID; if (str != null) { if (AuthorChHit.< > f__switch$map1 == null) { Dictionary <string, int> strs = new Dictionary <string, int>(3) { { "Sphere", 0 }, { "Box", 1 }, { "Capsule", 2 } }; AuthorChHit.< > f__switch$map1 = strs; } if (AuthorChHit.< > f__switch$map1.TryGetValue(str, out num)) { switch (num) { case 0: { this.kind = HitShapeKind.Sphere; break; } case 1: { this.kind = HitShapeKind.Box; break; } case 2: { this.kind = HitShapeKind.Capsule; break; } } } } base.OnRegistered(); }
private void OnClickTabBtn(GameObject go) { string name = go.get_name(); if (name != null) { if (GuildUI.< > f__switch$map16 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(2); dictionary.Add("JoinBtn", 0); dictionary.Add("CreateBtn", 1); GuildUI.< > f__switch$map16 = dictionary; } int num; if (GuildUI.< > f__switch$map16.TryGetValue(name, ref num)) { if (num != 0) { if (num == 1) { this.currentState = GuildUIState.GuildCreate; } } else { this.currentState = GuildUIState.GuildJoin; } } } if (this.currentState == this.lastState) { return; } this.SetBtnLightAndDim(go, "fenleianniu_1", true); if (this.BtnGuildUIDic.ContainsKey(this.lastState)) { this.SetBtnLightAndDim(this.BtnGuildUIDic.get_Item(this.lastState).get_gameObject(), "fenleianniu_2", false); } this.RefreshUIState(this.currentState); this.lastState = this.currentState; }
public override void OnMessage(IMessage message) { string name = message.Name; object body = message.Body; string text = name; if (text != null) { if (AppView.< > f__switch$map0 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(4); dictionary.Add("UpdateMessage", 0); dictionary.Add("UpdateExtract", 1); dictionary.Add("UpdateDownload", 2); dictionary.Add("UpdateProgress", 3); AppView.< > f__switch$map0 = dictionary; } int num; if (AppView.< > f__switch$map0.TryGetValue(text, ref num)) { switch (num) { case 0: this.UpdateMessage(body.ToString()); break; case 1: this.UpdateExtract(body.ToString()); break; case 2: this.UpdateDownload(body.ToString()); break; case 3: this.UpdateProgress(body.ToString()); break; } } } }
public virtual void OnNotifyPropChanged(NotifyPropChangedCmd cmd) { string propName = cmd.propName; if (propName != null) { if (NPCBehavior.< > f__switch$map1A == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(1); dictionary.Add("AnimFactor", 0); NPCBehavior.< > f__switch$map1A = dictionary; } int num; if (NPCBehavior.< > f__switch$map1A.TryGetValue(propName, ref num)) { if (num == 0) { this.FrameActionSpeed = cmd.propValue; } } } }
private void SetCurrentMesh(string part, string item) { int num = int.Parse(item); if (part != null) { if (TestChar.< > f__switch$map14 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(4); dictionary.Add("hair", 0); dictionary.Add("pants", 1); dictionary.Add("shoes", 2); dictionary.Add("top", 3); TestChar.< > f__switch$map14 = dictionary; } int num2; if (TestChar.< > f__switch$map14.TryGetValue(part, ref num2)) { switch (num2) { case 0: this.currentHairMesh = num; break; case 1: this.currentPantsMesh = num; break; case 2: this.currentShoesMesh = num; break; case 3: this.currentTopMesh = num; break; } } } }
private void onReceiveNotifications(IList <ReceivedNotification> notifications) { IEnumerator <ReceivedNotification> enumerator = notifications.GetEnumerator(); try { while (enumerator.MoveNext()) { string str; int num; ReceivedNotification current = enumerator.Current; current.userData.TryGetValue("nskclientaction", out str); string key = str; if (key == null) { return; } if (< > f__switch$map9 == null) { Dictionary <string, int> dictionary2 = new Dictionary <string, int>(2); dictionary2.Add("updateplayer", 0); dictionary2.Add("updatetournament", 1); < > f__switch$map9 = dictionary2; }
private void ReadBundleListing(string nameOfBundle) { int num; if (!this.json.Read()) { throw new JsonException("End of stream unexpected"); } if (this.json.Token != JsonToken.ObjectStart) { throw new JsonException(string.Concat("Expected object start for bundle name (property) ", nameOfBundle)); } this.item.Name = nameOfBundle; this.item.ByteLength = -1; while (true) { if (!this.json.Read()) { throw new JsonException("Unexpected end of stream"); } if (this.json.Token == JsonToken.ObjectEnd) { if (string.IsNullOrEmpty(this.item.Path)) { throw new JsonException(string.Concat("Path to bundle not defined for bundle listing ", nameOfBundle)); } if (this.item.ByteLength == -1) { throw new JsonException(string.Concat("There was no size property for bundle listing ", nameOfBundle)); } ContentType contentType = this.item.ContentType; if (contentType != ContentType.Assets) { if (contentType != ContentType.Scenes) { throw new JsonException(string.Concat(new object[] { "The content ", this.item.ContentType, " was not handled for bundle listing ", nameOfBundle })); } if (this.item.TypeOfAssets != null) { throw new JsonException(string.Concat("There should not have been a type property for scene bundle listing ", nameOfBundle)); } } else if (this.item.TypeOfAssets == null) { throw new JsonException(string.Concat("There was no valid type property for asset bundle listing ", nameOfBundle)); } return; } if (this.json.Token != JsonToken.PropertyName) { throw new JsonException(string.Concat("Unexpected token in json : JsonToken.", this.json.Token)); } bool flag = false; string asString = this.json.Value.AsString; if (asString == null) { break; } if (Reader.< > f__switch$map4 == null) { Dictionary <string, int> strs = new Dictionary <string, int>(5) { { "type", 0 }, { "size", 1 }, { "content", 2 }, { "filename", 3 }, { "url", 4 } }; Reader.< > f__switch$map4 = strs; } if (!Reader.< > f__switch$map4.TryGetValue(asString, out num)) { break; } switch (num) { case 0: { if (!this.json.Read()) { throw new JsonException("Unexpected end of stream at type"); } switch (this.json.Token) { case JsonToken.String: { try { this.item.TypeOfAssets = Reader.ParseType(this.json.Value.AsString); } catch (TypeLoadException typeLoadException) { throw new JsonException(this.json.Value.AsString, typeLoadException); } break; } case JsonToken.Boolean: { throw new JsonException(string.Concat("the type property expects only null or string. got : ", this.json.Token)); } case JsonToken.Null: { this.item.TypeOfAssets = null; break; } default: { throw new JsonException(string.Concat("the type property expects only null or string. got : ", this.json.Token)); } } break; } case 1: { if (!this.json.Read()) { throw new JsonException("Unexpected end of stream at size"); } switch (this.json.Token) { case JsonToken.Int: case JsonToken.Float: { this.item.ByteLength = this.json.Value.AsInt; break; } case JsonToken.Reserved: { throw new JsonException(string.Concat("the size property expects a number. got : ", this.json.Token)); } default: { throw new JsonException(string.Concat("the size property expects a number. got : ", this.json.Token)); } } break; } case 2: { if (!this.json.Read()) { throw new JsonException("Unexpected end of stream at content"); } switch (this.json.Token) { case JsonToken.Int: { this.item.ContentType = (ContentType)((byte)this.json.Value.AsInt); break; } case JsonToken.Reserved: case JsonToken.Float: { throw new JsonException(string.Concat("the content property expects a string or int. got : ", this.json.Token)); } case JsonToken.String: { try { this.item.ContentType = (ContentType)((byte)Enum.Parse(typeof(ContentType), this.json.Value.AsString, true)); } catch (ArgumentException argumentException) { throw new JsonException(this.json.Value.AsString, argumentException); } catch (OverflowException overflowException) { throw new JsonException(this.json.Value.AsString, overflowException); } break; } default: { throw new JsonException(string.Concat("the content property expects a string or int. got : ", this.json.Token)); } } break; } case 3: { if (!this.json.Read()) { throw new JsonException("Unexpected end of stream at filename"); } if (this.json.Token != JsonToken.String) { throw new JsonException(string.Concat("the filename property expects a string. got : ", this.json.Token)); } if (!flag) { try { this.item.Path = this.PathToBundle(this.json.Value.AsString); } catch (Exception exception) { throw new JsonException(this.json.Value.AsString, exception); } break; } else { break; } } case 4: { if (!this.json.Read()) { throw new JsonException("Unexpected end of stream at url"); } if (this.json.Token != JsonToken.String) { throw new JsonException(string.Concat("the url property expects a string. got : ", this.json.Token)); } try { this.item.Path = this.json.Value.AsString; } catch (Exception exception1) { throw new JsonException(this.json.Value.AsString, exception1); } flag = true; break; } default: { throw new JsonException(string.Concat("Unhandled property named ", this.json.Value.AsString)); } } } throw new JsonException(string.Concat("Unhandled property named ", this.json.Value.AsString)); }
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); }
private GameObject CreateAnimObj(string animName, bool createForInit = false) { UiAnimMgr.AnimData animData; this.m_animData.TryGetValue(animName, ref animData); if (animData == null) { return(null); } GameObject gameObject = null; if (!createForInit && animData.m_availableObjects.get_Count() > 0) { gameObject = animData.m_availableObjects.Pop(); } if (gameObject != null) { if (animData.m_activeObjects.Contains(gameObject)) { Debug.Log("Error! new anim object already in active object list."); } else { animData.m_activeObjects.Add(gameObject); } gameObject.SetActive(true); UiAnimation component = gameObject.GetComponent <UiAnimation>(); component.Reset(); component.m_ID = this.GetNextID(); return(gameObject); } gameObject = new GameObject(); if (createForInit) { animData.m_availableObjects.Push(gameObject); } else if (animData.m_activeObjects.Contains(gameObject)) { Debug.Log("Error! new anim object already in active object list."); } else { animData.m_activeObjects.Add(gameObject); } CanvasGroup canvasGroup = gameObject.AddComponent <CanvasGroup>(); canvasGroup.set_blocksRaycasts(false); canvasGroup.set_interactable(false); gameObject.set_name(animName); UiAnimation uiAnimation = gameObject.AddComponent <UiAnimation>(); uiAnimation.m_ID = this.GetNextID(); uiAnimation.Deserialize(animName); RectTransform rectTransform = gameObject.AddComponent <RectTransform>(); rectTransform.SetSizeWithCurrentAnchors(0, uiAnimation.GetFrameWidth()); rectTransform.SetSizeWithCurrentAnchors(1, uiAnimation.GetFrameHeight()); using (Dictionary <string, UiAnimation.UiTexture> .ValueCollection.Enumerator enumerator = uiAnimation.m_textures.get_Values().GetEnumerator()) { while (enumerator.MoveNext()) { UiAnimation.UiTexture current = enumerator.get_Current(); GameObject gameObject2 = new GameObject(); gameObject2.set_name(current.m_parentKey + "_Texture"); gameObject2.get_transform().SetParent(gameObject.get_transform(), false); current.m_image = gameObject2.AddComponent <Image>(); current.m_image.set_sprite(current.m_sprite); current.m_image.get_canvasRenderer().SetAlpha(current.m_alpha); if (current.m_alphaMode == "ADD") { current.m_image.set_material(new Material(UiAnimMgr.instance.m_additiveMaterial)); } else { current.m_image.set_material(new Material(UiAnimMgr.instance.m_blendMaterial)); } current.m_image.get_material().set_mainTexture(current.m_sprite.get_texture()); RectTransform component2 = gameObject2.GetComponent <RectTransform>(); int num; if (current.m_anchor != null && current.m_anchor.relativePoint != null) { string text = current.m_anchor.relativePoint; if (text != null) { if (UiAnimMgr.< > f__switch$map9 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(9); dictionary.Add("TOP", 0); dictionary.Add("BOTTOM", 1); dictionary.Add("LEFT", 2); dictionary.Add("RIGHT", 3); dictionary.Add("CENTER", 4); dictionary.Add("TOPLEFT", 5); dictionary.Add("TOPRIGHT", 6); dictionary.Add("BOTTOMLEFT", 7); dictionary.Add("BOTTOMRIGHT", 8); UiAnimMgr.< > f__switch$map9 = dictionary; } if (UiAnimMgr.< > f__switch$map9.TryGetValue(text, ref num)) { switch (num) { case 0: component2.set_anchorMin(new Vector2(0.5f, 1f)); component2.set_anchorMax(component2.get_anchorMin()); break; case 1: component2.set_anchorMin(new Vector2(0.5f, 0f)); component2.set_anchorMax(component2.get_anchorMin()); break; case 2: component2.set_anchorMin(new Vector2(0f, 0.5f)); component2.set_anchorMax(component2.get_anchorMin()); break; case 3: component2.set_anchorMin(new Vector2(1f, 0.5f)); component2.set_anchorMax(component2.get_anchorMin()); break; case 4: component2.set_anchorMin(new Vector2(0.5f, 0.5f)); component2.set_anchorMax(component2.get_anchorMin()); break; case 5: component2.set_anchorMin(new Vector2(0f, 1f)); component2.set_anchorMax(component2.get_anchorMin()); break; case 6: component2.set_anchorMin(new Vector2(1f, 1f)); component2.set_anchorMax(component2.get_anchorMin()); break; case 7: component2.set_anchorMin(new Vector2(0f, 0f)); component2.set_anchorMax(component2.get_anchorMin()); break; case 8: component2.set_anchorMin(new Vector2(1f, 0f)); component2.set_anchorMax(component2.get_anchorMin()); break; } } } } Vector2 anchoredPosition = default(Vector2); if (current.m_anchor != null && current.m_anchor.point != null) { string text = current.m_anchor.point; if (text != null) { if (UiAnimMgr.< > f__switch$mapA == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(9); dictionary.Add("TOP", 0); dictionary.Add("BOTTOM", 1); dictionary.Add("LEFT", 2); dictionary.Add("RIGHT", 3); dictionary.Add("CENTER", 4); dictionary.Add("TOPLEFT", 5); dictionary.Add("TOPRIGHT", 6); dictionary.Add("BOTTOMLEFT", 7); dictionary.Add("BOTTOMRIGHT", 8); UiAnimMgr.< > f__switch$mapA = dictionary; } if (UiAnimMgr.< > f__switch$mapA.TryGetValue(text, ref num)) { switch (num) { case 0: anchoredPosition.Set(0f, -0.5f * current.m_image.get_sprite().get_rect().get_height()); break; case 1: anchoredPosition.Set(0f, 0.5f * current.m_image.get_sprite().get_rect().get_height()); break; case 2: anchoredPosition.Set(0.5f * current.m_image.get_sprite().get_rect().get_width(), 0f); break; case 3: anchoredPosition.Set(-0.5f * current.m_image.get_sprite().get_rect().get_width(), 0f); break; case 5: anchoredPosition.Set(0.5f * current.m_image.get_sprite().get_rect().get_width(), -0.5f * current.m_image.get_sprite().get_rect().get_height()); break; case 6: anchoredPosition.Set(-0.5f * current.m_image.get_sprite().get_rect().get_width(), -0.5f * current.m_image.get_sprite().get_rect().get_height()); break; case 7: anchoredPosition.Set(0.5f * current.m_image.get_sprite().get_rect().get_width(), 0.5f * current.m_image.get_sprite().get_rect().get_height()); break; case 8: anchoredPosition.Set(-0.5f * current.m_image.get_sprite().get_rect().get_width(), 0.5f * current.m_image.get_sprite().get_rect().get_height()); break; } } } } component2.set_anchoredPosition(anchoredPosition); component2.SetSizeWithCurrentAnchors(0, current.m_image.get_sprite().get_rect().get_width()); component2.SetSizeWithCurrentAnchors(1, current.m_image.get_sprite().get_rect().get_height()); } } using (Dictionary <string, UiAnimation.UiTexture> .ValueCollection.Enumerator enumerator2 = uiAnimation.m_textures.get_Values().GetEnumerator()) { while (enumerator2.MoveNext()) { UiAnimation.UiTexture current2 = enumerator2.get_Current(); RectTransform rectTransform2 = current2.m_image.get_rectTransform(); current2.m_localPosition = rectTransform2.get_localPosition(); } } return(gameObject); }
private void OnEnable() { this.m_legionLogo.SetActive(false); this.m_legionLogo_CN.SetActive(false); this.m_legionLogo_TW.SetActive(false); string locale = Main.instance.GetLocale(); if (locale == "zhCN") { this.m_legionLogo_CN.SetActive(true); } else if (locale == "zhTW") { this.m_legionLogo_TW.SetActive(true); } else { this.m_legionLogo.SetActive(true); } if (Login.instance.IsDevRegionList()) { for (int i = 0; i < this.m_portalDropdown.get_options().get_Count(); i++) { if (this.m_portalDropdown.get_options().ToArray()[i].get_text().ToLower() == Login.instance.GetBnPortal()) { this.m_showDialog = false; this.m_portalDropdown.set_value(i); this.m_showDialog = true; break; } } } else { int value = 0; string bnPortal = Login.instance.GetBnPortal(); if (bnPortal != null) { if (TitlePanel.< > f__switch$map8 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(4); dictionary.Add("us", 0); dictionary.Add("eu", 1); dictionary.Add("kr", 2); dictionary.Add("cn", 3); TitlePanel.< > f__switch$map8 = dictionary; } int num; if (TitlePanel.< > f__switch$map8.TryGetValue(bnPortal, ref num)) { switch (num) { case 0: value = 0; break; case 1: value = 1; break; case 2: value = 2; break; case 3: value = 3; break; } } } this.m_showDialog = false; this.m_portalDropdown.set_value(value); this.m_showDialog = true; } this.CancelIndex = this.m_portalDropdown.get_value(); }
private static ObjImporter.meshStruct createMeshStruct(string filename) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; ObjImporter.meshStruct result = default(ObjImporter.meshStruct); result.fileName = filename; StreamReader streamReader = File.OpenText(filename); string text = streamReader.ReadToEnd(); streamReader.Dispose(); using (StringReader stringReader = new StringReader(text)) { string text2 = stringReader.ReadLine(); char[] array = new char[] { ' ' }; while (text2 != null) { if (!text2.StartsWith("f ") && !text2.StartsWith("v ") && !text2.StartsWith("vt ") && !text2.StartsWith("vn ")) { text2 = stringReader.ReadLine(); if (text2 != null) { text2 = text2.Replace(" ", " "); } } else { text2 = text2.Trim(); string[] array2 = text2.Split(array, 50); string text3 = array2[0]; string text4 = text3; if (text4 != null) { if (ObjImporter.< > f__switch$map1 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(4); dictionary.Add("v", 0); dictionary.Add("vt", 1); dictionary.Add("vn", 2); dictionary.Add("f", 3); ObjImporter.< > f__switch$map1 = dictionary; } int num6; if (ObjImporter.< > f__switch$map1.TryGetValue(text4, ref num6)) { switch (num6) { case 0: num2++; break; case 1: num3++; break; case 2: num4++; break; case 3: num5 = num5 + array2.Length - 1; num += 3 * (array2.Length - 2); break; } } } text2 = stringReader.ReadLine(); if (text2 != null) { text2 = text2.Replace(" ", " "); } } } } result.triangles = new int[num]; result.vertices = new Vector3[num2]; result.uv = new Vector2[num3]; result.normals = new Vector3[num4]; result.faceData = new Vector3[num5]; return(result); }
private static void populateMeshStruct(ref ObjImporter.meshStruct mesh) { StreamReader streamReader = File.OpenText(mesh.fileName); string text = streamReader.ReadToEnd(); streamReader.Close(); using (StringReader stringReader = new StringReader(text)) { string text2 = stringReader.ReadLine(); char[] array = new char[] { ' ' }; char[] array2 = new char[] { '/' }; int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; while (text2 != null) { if (!text2.StartsWith("f ") && !text2.StartsWith("v ") && !text2.StartsWith("vt ") && !text2.StartsWith("vn ") && !text2.StartsWith("g ") && !text2.StartsWith("usemtl ") && !text2.StartsWith("mtllib ") && !text2.StartsWith("vt1 ") && !text2.StartsWith("vt2 ") && !text2.StartsWith("vc ") && !text2.StartsWith("usemap ")) { text2 = stringReader.ReadLine(); if (text2 != null) { text2 = text2.Replace(" ", " "); } } else { text2 = text2.Trim(); string[] array3 = text2.Split(array, 50); string text3 = array3[0]; string text4 = text3; if (text4 != null) { if (ObjImporter.< > f__switch$map2 == null) { Dictionary <string, int> dictionary = new Dictionary <string, int>(6); dictionary.Add("v", 0); dictionary.Add("vt", 1); dictionary.Add("vt1", 2); dictionary.Add("vt2", 3); dictionary.Add("vn", 4); dictionary.Add("f", 5); ObjImporter.< > f__switch$map2 = dictionary; } int num8; if (ObjImporter.< > f__switch$map2.TryGetValue(text4, ref num8)) { switch (num8) { case 0: mesh.vertices[num3] = new Vector3(Convert.ToSingle(array3[1]), Convert.ToSingle(array3[2]), Convert.ToSingle(array3[3])); num3++; break; case 1: mesh.uv[num5] = new Vector2(Convert.ToSingle(array3[1]), Convert.ToSingle(array3[2])); num5++; break; case 2: mesh.uv[num6] = new Vector2(Convert.ToSingle(array3[1]), Convert.ToSingle(array3[2])); num6++; break; case 3: mesh.uv[num7] = new Vector2(Convert.ToSingle(array3[1]), Convert.ToSingle(array3[2])); num7++; break; case 4: mesh.normals[num4] = new Vector3(Convert.ToSingle(array3[1]), Convert.ToSingle(array3[2]), Convert.ToSingle(array3[3])); num4++; break; case 5: { int num9 = 1; List <int> list = new List <int>(); while (num9 < array3.Length && (string.Empty + array3[num9]).get_Length() > 0) { Vector3 vector = default(Vector3); string[] array4 = array3[num9].Split(array2, 3); vector.x = (float)Convert.ToInt32(array4[0]); if (array4.Length > 1) { if (array4[1] != string.Empty) { vector.y = (float)Convert.ToInt32(array4[1]); } vector.z = (float)Convert.ToInt32(array4[2]); } num9++; mesh.faceData[num2] = vector; list.Add(num2); num2++; } num9 = 1; while (num9 + 2 < array3.Length) { mesh.triangles[num] = list.get_Item(0); num++; mesh.triangles[num] = list.get_Item(num9); num++; mesh.triangles[num] = list.get_Item(num9 + 1); num++; num9++; } break; } } } } text2 = stringReader.ReadLine(); if (text2 != null) { text2 = text2.Replace(" ", " "); } } } } }