コード例 #1
0
        public static NewbieTeachItem initWithStr(string str)
        {
            string[] arrMain = str.Split(':');
            if (arrMain.Length != 3 && arrMain.Length != 2)
            {
                Debug.LogError("新手脚本初始化错误,冒号:" + str);
                return(null);
            }

            string[] arrTeach = arrMain[0].Split(',');



            string tempname = arrTeach[0];

            if (!dListener.ContainsKey(tempname))
            {
                Debug.LogError("新手脚本初始化错误文字错误:" + arrTeach[0] + ":" + arrMain[0] + "::::" + str);
                return(null);
            }

            NewbieTeachItem item = dListener[tempname](arrTeach);

            if (item == null)
            {
                Debug.LogError("初始化新手错误:" + arrMain[0]);
                return(null);
            }
            if (arrTeach[0] == "stop")
            {
                item.checkToDo = null;
                string[] arrDo = arrMain[1].Split('|');
                item.initDo(arrDo);
            }
            else
            {
                item.initCheck(arrMain[1]);
                string[] arrDo = arrMain[2].Split('|');
                item.initDo(arrDo);
            }

            return(item);
        }
コード例 #2
0
		public static NewbieTeachItem initWithStr(string str)
		{
			string[] array = str.Split(new char[]
			{
				':'
			});
			bool flag = array.Length != 3 && array.Length != 2;
			NewbieTeachItem result;
			if (flag)
			{
				Debug.LogError("新手脚本初始化错误,冒号:" + str);
				result = null;
			}
			else
			{
				string[] array2 = array[0].Split(new char[]
				{
					','
				});
				string key = array2[0];
				bool flag2 = !NewbieTeachItem.dListener.ContainsKey(key);
				if (flag2)
				{
					Debug.LogError(string.Concat(new string[]
					{
						"新手脚本初始化错误文字错误:",
						array2[0],
						":",
						array[0],
						"::::",
						str
					}));
					result = null;
				}
				else
				{
					NewbieTeachItem newbieTeachItem = NewbieTeachItem.dListener[key](array2);
					bool flag3 = newbieTeachItem == null;
					if (flag3)
					{
						Debug.LogError("初始化新手错误:" + array[0]);
						result = null;
					}
					else
					{
						bool flag4 = array2[0] == "stop";
						if (flag4)
						{
							newbieTeachItem.checkToDo = null;
							string[] dos = array[1].Split(new char[]
							{
								'|'
							});
							newbieTeachItem.initDo(dos);
						}
						else
						{
							newbieTeachItem.initCheck(array[1]);
							string[] dos2 = array[2].Split(new char[]
							{
								'|'
							});
							newbieTeachItem.initDo(dos2);
						}
						result = newbieTeachItem;
					}
				}
			}
			return result;
		}