Exemplo n.º 1
0
	public static void ConvertParameters(EngineManager manager, ParameterInfo[] parameterInfo, ref object[] parameters)
	{
		for (int i = 0; i < parameterInfo.Length; i++)
		{
			if (Common.TypeInheritsFrom(parameterInfo[i].ParameterType, typeof(EngineObject)) && parameters[i].GetType() == typeof(int))
			{
				parameters[i] = manager.GetObject<EngineObject>((int)parameters[i]);
			}

			if (parameterInfo[i].ParameterType == typeof(object[]))
			{
				object[] tempObjects = new object[parameters.Length - i];

				for (int j = 0; j < tempObjects.Length; j++)
				{
					tempObjects[j] = parameters[i + j];
				}

				parameters[i] = tempObjects;

				object[] newParameters = new object[i + 1];
				for (int j = 0; j < newParameters.Length; j++)
				{
					newParameters[j] = parameters[j];
				}

				parameters = newParameters;
			}
		}
	}