public void Import(DesignDataAgent designDataAgent, DesignDataAgentMethodManager designDataAgentMethodManager)
        {
            this.designDataAgent = designDataAgent;

            //Register method by this way.
            designDataAgentMethodManager.RegisterMethod(DesignDataAgentMethodManager.GetParseMethod(this));

            //Register param function by this way.
            designDataAgentMethodManager.RegisterParamFunc(DesignDataAgentMethodManager.GetParamMethod(this));
        }
Пример #2
0
        public void Import(DesignDataAgent designDataAgent, DesignDataAgentMethodManager designDataAgentMethodManager)
        {
            this.designDataAgent = designDataAgent;

            designDataAgentMethodManager.RegisterMethod(new Dictionary <string, Func <DesignDataAgent.CellInfo, CommandParam, DesignDataAgent.CommandExecuteResult> >
            {
                //DO

                ["int"]     = SetInt,
                ["float"]   = SetFloat,
                ["bool"]    = SetBool,
                ["string"]  = SetString,
                ["object"]  = SetObject,
                ["Vector2"] = SetVector2,
                ["Sprite"]  = SetSprite,
                ["enum"]    = SetEnumByName,

                ["Method"]    = Method,
                ["ForMethod"] = ForMethod,

                ["CreateAsset"] = CreateAsset,
                ["SaveAssets"]  = SaveAssets,
                ["Reset"]       = ResetPropertyValue,
                ["ClearArray"]  = ClearArray,
                ["Print"]       = PrintText,
                ["Invoke"]      = InvokeFunction,
                ["SetRoot"]     = SetRoot,

                //IF

                ["NotEmpty"]         = NotEmpty,
                ["IsEmpty"]          = IsEmpty,
                ["IsEmptyString"]    = IsEmptyString,
                ["IsNotEmptyString"] = IsNotEmptyString,
                ["IsFirst"]          = IsFirst,
                ["IsLast"]           = IsLast,
                ["IsExist"]          = IsExist,
                ["IsNotExist"]       = IsNotExist,
                ["IsTrue"]           = IsTrue,
                ["IsFalse"]          = IsFalse,
                ["IsEqual"]          = IsEqual,
                ["IsNotEqual"]       = IsNotEqual,
            },
                                                        logRegister: false);

            designDataAgentMethodManager.RegisterParamFunc(new Dictionary <string, Func <string[], string> >
            {
                ["Calc"]         = Calc,
                ["GetCellValue"] = GetCellValue,
                ["ToInt"]        = ToInt,
            },
                                                           logRegister: false);
        }