Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        public void GetComponentMethods()
        {
            cacheMethods = Type.GetType(Components[ComponentIndex].GetType().Name)
                           .GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);

            serializedMethods = new SerializableMethodInfo[cacheMethods.Length];
            for (var i = 0; i < cacheMethods.Length; i++)
            {
                serializedMethods[i] = new SerializableMethodInfo(cacheMethods[i]);
            }
        }
Beispiel #2
0
 public void SetMethod(Type targetType, string methodName)
 {
     methodInfo = new SerializableMethodInfo(targetType.GetMethod(methodName));
     ParameterInfo[] pInfos = methodInfo.methodInfo.GetParameters();
     parameters = new SerializableObject[pInfos.Length];
     for (int i = 0; i < parameters.Length; i++)
     {
         parameters[i] = new SerializableObject(pInfos[i].ParameterType);
     }
     target = targetGO.GetComponent(targetType);
 }
Beispiel #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="list">The hero action field to construct.</param>
        public HeroActionField(HeroActionField field)
        {
            name = field.name;
            id   = field.id;

            ints           = field.ints.Select(x => x).ToList();
            floats         = field.floats.Select(x => x).ToList();
            strings        = field.strings.Select(x => x).ToList();
            bools          = field.bools.Select(x => x).ToList();
            gameObjects    = field.gameObjects.Select(x => x).ToList();
            heroObjects    = field.heroObjects.Select(x => x).ToList();
            unityObjects   = field.unityObjects.Select(x => x).ToList();
            colors         = field.colors.Select(x => x).ToList();
            heroProperties = field.heroProperties.Select(x => x).ToList();
            method         = field.method;
            component      = null;
        }