Beispiel #1
0
 void ParseParameters(string type, string arg)
 {
     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, ParseValue(this.type, name, args[i * 2 + 1], ref isDynamic));
                 }
             }
         }
     }
     catch (System.Exception e)
     {
         AddErrorMsg(arg + "内が、「パラメーター名=値」 の形式で書かれていません。");
         AddErrorMsg(e.Message);
     }
 }
Beispiel #2
0
        //初期化
        void Init(string type, string arg, string easeType, string loopType)
        {
            this.strType     = type;
            this.strArg      = arg;
            this.strEaseType = easeType;
            this.strLoopType = loopType;

            ParseParameters(type, arg);
            if (!string.IsNullOrEmpty(easeType))
            {
                HashObjects.Add(EaseType, easeType);
            }
            if (!string.IsNullOrEmpty(loopType))
            {
                try
                {
                    ParseLoopType(loopType);
                    HashObjects.Add(LoopType, this.loopType);
                }
                catch (System.Exception e)
                {
                    AddErrorMsg(loopType + "は、LoopTypeとして解析できません。");
                    AddErrorMsg(e.Message);
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// 再初期化
 /// </summary>
 public void ReInit()
 {
     if (isDynamic)
     {
         HashObjects.Clear();
         Init(strType, strArg, strEaseType, strLoopType);
     }
 }
Beispiel #4
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]));
                        }
                    }
                }
            }
            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);
                }
            }
        }