Exemple #1
0
 public void Init(Object _obj, MethodList _methodInfos)
 {
     MemberInit(_obj, _methodInfos.First(), typeof(MethodMono));
     returnType       = GetReturnType(_methodInfos.First());
     parameterOptions = GetParameterOptions(_methodInfos);
     children.Add(returnType);
     children.Add(parameterOptions);
 }
Exemple #2
0
        public ScriptableHeader GetReturnType(MethodInfo method)
        {
            var children = new List <ScriptableBase> ();

            children.Add(ScriptableHeader.CreateEmptyHeader(method.ReturnType.AssemblyQualifiedName));
            var name = "Return Type: " + Utilities.TypeToString(method.ReturnType);

            return(ScriptableHeader.CreateHeader(name, children));
        }
Exemple #3
0
        public static ScriptableHeader GetAssemblies(string _assemblyFilter, string _typeFilter, InstantiatorBase _instantiator)
        {
            var assemblies = AppDomain.CurrentDomain.GetAssemblies().
                             Where(a => a.FullName.Contains(_assemblyFilter)).
                             OrderBy(a => a.FullName).
                             ToList();
            var children = new List <ScriptableBase> ();

            assemblies.ForEach(a => children.Add(CreateAssembly(a, _typeFilter, _instantiator)));
            return(ScriptableHeader.CreateHeader("Assemblies", children));
        }
Exemple #4
0
        public ScriptableHeader GetParameterOptions(MethodList methods)
        {
            var children = new List <ScriptableBase> ();

            foreach (var method in methods)
            {
                var parametersString = Utilities.ParameterArrayToString(method.GetParameters());
                children.Add(ScriptableHeader.CreateEmptyHeader(parametersString));
            }
            return(ScriptableHeader.CreateHeader("Parameter Options", children));
        }
Exemple #5
0
        public void Init(Object _obj, PropertyInfo _property)
        {
            propertyInfo = _property;
            MemberInit(_obj, _property, getZTypeMatch(_property));
            propertyType = ScriptableHeader.CreateEmptyHeader("Property Type: " + _property.PropertyType.ToString());
            string valueString = (GetValue() == null) ? "null" : GetValue().ToString();

            value = ScriptableHeader.CreateEmptyHeader(valueString);
            children.Add(propertyType);
            children.Add(value);
        }
        ScriptableHeader GetChildren(GameObject go, InstantiatorBase _instantiator)
        {
            var scriptableChildren = new List <ScriptableBase> ();

            foreach (var child in go.transform.Cast <Object>())
            {
                var scriptableChild = ScriptableObject.CreateInstance <ScriptableObjectPointer> ();
                scriptableChild.Init(child, child.name, _instantiator);
                scriptableChildren.Add(scriptableChild);
            }
            return(ScriptableHeader.CreateHeader("Children", scriptableChildren));
        }
Exemple #7
0
        public static ScriptableHeader GetPrimitives(PrimitiveInstantiator _instantiator)
        {
            var primitives = new List <ScriptableBase> ();

            foreach (var zType in GetZTypes())
            {
                var primitive = ScriptableObject.CreateInstance <ScriptablePrimitive> ();
                primitive.Init(zType);
                primitive.AddDelegate(_instantiator);
                primitives.Add(primitive);
            }
            return(ScriptableHeader.CreateHeader("Zodiac Types", primitives));
        }
Exemple #8
0
        static ScriptableHeader CreateScriptableMethods(Object _obj, Type type, InstantiatorBase _instantiator)
        {
            var methodDictionary  = GetMethodDictionary(type);
            var scriptableMethods = new List <ScriptableBase> ();

            foreach (var kvp in methodDictionary)
            {
                var scriptableMethod = ScriptableObject.CreateInstance <ScriptableMethod> ();
                scriptableMethod.Init(_obj, kvp.Value);
                scriptableMethod.AddDelegate(_instantiator);
                scriptableMethods.Add(scriptableMethod);
            }

            return(ScriptableHeader.CreateHeader("Methods", scriptableMethods));
        }
        ScriptableHeader GetComponents(GameObject go, InstantiatorBase _instantiator)
        {
            var scriptableComponents = new List <ScriptableBase> ();

            foreach (var component in go.GetComponents <Component>())
            {
                //mesh is not instantiated until play so these cause trouble
                if (component is MeshFilter || component is MeshRenderer)
                {
                    continue;
                }
                var scriptableComponent = ScriptableObject.CreateInstance <ScriptableObjectPointer> ();
                var sName = Utilities.ObjectTypeToString(component);
                scriptableComponent.Init(component, sName, _instantiator);
                scriptableComponents.Add(scriptableComponent);
            }
            return(ScriptableHeader.CreateHeader("Components", scriptableComponents));
        }
Exemple #10
0
        //obj will be null for static types
        static ScriptableHeader CreateScriptableProperty(Object obj, Type type, InstantiatorBase _instantiator)
        {
            var scriptableProperties = new List <ScriptableBase> ();

            foreach (var property in type.GetProperties().OrderBy(p => p.Name))
            {
                if (!validProperty(property))
                {
                    continue;
                }
                var scriptableProperty = ScriptableObject.CreateInstance <ScriptableProperty> ();
                scriptableProperty.Init(obj, property);
                if (scriptableProperty.isInstantiatable)
                {
                    scriptableProperties.Add(scriptableProperty);
                    scriptableProperty.AddDelegate(_instantiator);
                }
            }
            return(ScriptableHeader.CreateHeader("Properties", scriptableProperties));
        }
Exemple #11
0
 static ScriptableHeader CheckEmpty(ScriptableHeader header)
 {
     return((header.children.Count == 0) ? null : header);
 }