コード例 #1
0
        public void InitBehaviour()
        {
            if (!isInited)
            {
                isInited = true;

                if (ctrParamValues.Count == 0)
                {
                    Table = LuaUtility.RequireAndInstance(Env, scriptPath);
                }
                else
                {
                    SystemObject[] arr = new SystemObject[ctrParamValues.Count];
                    for (int i = 0; i < ctrParamValues.Count; ++i)
                    {
                        LuaParamValue lpv = ctrParamValues[i];
                        if (lpv != null)
                        {
                            arr[i] = lpv.GetValue();
                        }
                    }

                    Table = LuaUtility.RequireAndInstanceWith(Env, scriptPath, arr);
                }

                OnInitFinished();
            }
        }
コード例 #2
0
 private void RegisterParamToTable(LuaTable table, int index, LuaParamValue paramValue)
 {
     if (!IsValid() || paramValue == null)
     {
         return;
     }
     table.Set(index, paramValue.GetValue());
 }
コード例 #3
0
 private void RegisterParamToTable(LuaTable table, string name, LuaParamValue paramValue)
 {
     if (string.IsNullOrEmpty(name) || !IsValid() || paramValue == null)
     {
         return;
     }
     table.Set(name, paramValue.GetValue());
 }
コード例 #4
0
 public SystemObject[] GetValues()
 {
     SystemObject[] arr = new SystemObject[values.Count];
     for (int i = 0; i < values.Count; ++i)
     {
         LuaParamValue lpv = values[i];
         if (lpv != null)
         {
             arr[i] = lpv.GetValue();
         }
     }
     return(arr);
 }