Exemplo n.º 1
0
    public FuncGroup GetFuncGroup(int iFuncGroupId)
    {
        FuncConfigTable config = TryGetConfig <FuncConfigTable>(ConfigPath_FunctionGroupConfig);
        FuncGroup       result = null;

        config.FuncMap.TryGetValue(iFuncGroupId, out result);
        return(result);
    }
Exemplo n.º 2
0
    static public int HandleFuncExec(HandleTarget Target, int iFuncGroupId, FuncContext context)
    {
        if (null == Target || 0 == iFuncGroupId)
        {
            return(0);
        }

        FuncGroup funcdataGroup = ConfigManager.Instance.GetFuncGroup(iFuncGroupId);

        if (null == funcdataGroup || null == funcdataGroup.FuncDataList)
        {
            return(0);
        }

        //Exec Func
        FuncData ExecData = null;
        int      iLoop    = 0;

        for ( ; iLoop < funcdataGroup.FuncDataList.Count; ++iLoop)
        {
            ExecData = funcdataGroup.FuncDataList[iLoop];
            if (null == ExecData)
            {
                continue;
            }

            FuncMethodsBase func = null;
            FuncExec.TryGetValue(ExecData.Id, out func);
            //
            if (null == func)
            {
                continue;
            }

            EFuncRet eRet = func.FuncExecHandler(Target, ExecData, context);

            if (EFuncRet.Break == eRet)
            {
                break;
            }
            else if (EFuncRet.Error == eRet)
            {
                UnityEngine.Debug.LogWarning("HandleFuncExec is error, id : " + ExecData.Id.ToString());
            }
        }

        if (iLoop == funcdataGroup.FuncDataList.Count)
        {
            return(-1);
        }

        return(iLoop);
    }