Ejemplo n.º 1
0
        /// <summary>
        /// 引数名とitweenのタイプが対応しているかチェック
        /// </summary>
        /// <param name="type">itweenのタイプ</param>
        /// <param name="name">引数名</param>
        /// <returns></returns>
        public static bool IsPostionType(iTweenType type)
        {
            switch (type)
            {
            case iTweenType.MoveAdd:
            case iTweenType.MoveBy:
            case iTweenType.MoveFrom:
            case iTweenType.MoveTo:
            case iTweenType.PunchPosition:
            case iTweenType.ShakePosition:
                return(true);

            default:
                return(false);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 引数名とitweenのタイプが対応しているかチェック
 /// </summary>
 /// <param name="type">itweenのタイプ</param>
 /// <param name="name">引数名</param>
 /// <returns></returns>
 static bool CheckArg(iTweenType type, string name)
 {
     return(System.Array.IndexOf(ArgTbl[(int)type], name) >= 0);
 }
Ejemplo n.º 3
0
 public iTweenData(iTweenType type, string arg)
 {
     Init(type.ToString(), arg, "", "");
 }
Ejemplo n.º 4
0
		/// <summary>
		/// 引数名とitweenのタイプが対応しているかチェック
		/// </summary>
		/// <param name="type">itweenのタイプ</param>
		/// <param name="name">引数名</param>
		/// <returns></returns>
		public static bool IsPostionType(iTweenType type)
		{
			switch (type)
			{
				case iTweenType.MoveAdd:
				case iTweenType.MoveBy:
				case iTweenType.MoveFrom:
				case iTweenType.MoveTo:
				case iTweenType.PunchPosition:
				case iTweenType.ShakePosition:
					return true;
				default:
					return false;
			}
		}
Ejemplo n.º 5
0
		/// <summary>
		/// 引数名とitweenのタイプが対応しているかチェック
		/// </summary>
		/// <param name="type">itweenのタイプ</param>
		/// <param name="name">引数名</param>
		/// <returns></returns>
		static bool CheckArg(iTweenType type, string name)
		{
			return (System.Array.IndexOf(ArgTbl[(int)type], name) >= 0);
		}
Ejemplo n.º 6
0
		/// <summary>
		/// itweenの引数の値を文字列から解析
		/// </summary>
		/// <param name="type">itweenのタイプ</param>
		/// <param name="name">引数の名前</param>
		/// <param name="valueString">値の文字列</param>
		/// <returns>値</returns>
		static object ParseValue(iTweenType type, string name, string valueString, ref bool isDynamic )
		{
			object paramValue = null;
			if (CallbackGetValue != null)
			{
				paramValue = CallbackGetValue(valueString);
				isDynamic = true;
			}
			if (CheckArg(type, name))
			{
				switch (name)
				{
					case Time:
					case Delay:
					case Speed:
					case Alpha:
					case R:
					case G:
					case B:
					case A:
					case X:
					case Y:
					case Z:
						if (paramValue != null )
						{
							return (float)paramValue;
						}
						else
						{
							return float.Parse(valueString);
						}
					case Islocal: 
						if (paramValue != null )
						{
							return (bool)paramValue;
						}
						else
						{
							return bool.Parse(valueString);
						}
					case Color:
						return ColorUtil.ParseColor(valueString);
					default:
						return null;
				}
			}
			else
			{
				return null;
			}
		}
Ejemplo n.º 7
0
		//初期化
		void Init(string type, string arg, string easeType, string loopType)
		{
			this.strType = type;
			this.strArg = arg;
			this.strEaseType = easeType;
			this.strLoopType = loopType;
			try
			{
				this.type = (iTweenType)System.Enum.Parse(typeof(iTweenType), type);
				if (this.type == iTweenType.Stop)
				{
					return;
				}
				else
				{
					char[] separator = { ' ', '=' };
					string[] args = arg.Split(separator, System.StringSplitOptions.RemoveEmptyEntries);
					if (args.Length % 2 != 0 || args.Length <= 0)
					{
						AddErrorMsg(arg + "内が、「パラメーター名=値」 の形式で書かれていません。");
					}
					else
					{
						for (int i = 0; i < args.Length / 2; ++i)
						{
							string name = args[i * 2];
							HashObjects.Add(name);
							HashObjects.Add(ParseValue(this.type, name, args[i * 2 + 1],ref isDynamic));
						}
					}
				}
			}
			catch (System.Exception e)
			{
				AddErrorMsg(arg + "内が、「パラメーター名=値」 の形式で書かれていません。");
				AddErrorMsg(e.Message);
			}
			
			if (!string.IsNullOrEmpty(easeType))
			{
				HashObjects.Add("easeType");
				HashObjects.Add(easeType);
			}
			if (!string.IsNullOrEmpty(loopType))
			{
				try
				{
					ParseLoopType(loopType);
					HashObjects.Add("loopType");
					HashObjects.Add(this.loopType);
				}
				catch (System.Exception e)
				{
					AddErrorMsg(loopType + "は、LoopTypeとして解析できません。");
					AddErrorMsg(e.Message);
				}
			}
		}
Ejemplo n.º 8
0
 public iTweenData(iTweenType type, string arg)
 {
     this.hashObjects = new Dictionary <string, object>();
     this.errorMsg    = string.Empty;
     this.Init(type.ToString(), arg, string.Empty, string.Empty);
 }
Ejemplo n.º 9
0
 private static bool CheckArg(iTweenType type, string name)
 {
     return(Array.IndexOf <string>(ArgTbl[(int)type], name) >= 0);
 }