コード例 #1
0
ファイル: JEComponent.cs プロジェクト: Cucala/code-1
        public static void QueryComponents(JEGameObject jgo)
        {
            // for every registered conversion get that component
            foreach (KeyValuePair <Type, Type> pair in conversions)
            {
                Component[] components = jgo.unityGameObject.GetComponents(pair.Key);

                foreach (Component component in components)
                {
                    MeshRenderer meshRenderer = component as MeshRenderer;
                    if (meshRenderer != null && !meshRenderer.enabled)
                    {
                        continue;
                    }

                    var jcomponent = Activator.CreateInstance(pair.Value) as JEComponent;

                    if (jcomponent == null)
                    {
                        ExportError.FatalError("Export component creation failed");
                    }

                    jcomponent.unityComponent = component;
                    jcomponent.jeGameObject   = jgo;
                    jgo.AddComponent(jcomponent);
                }
            }
        }
コード例 #2
0
        static void reset()
        {
            JEResource.Reset();
            JEComponent.Reset();
            JEScene.Reset();
            JEGameObject.Reset();

            JEComponent.RegisterStandardComponents();
        }
コード例 #3
0
        static JEGameObject Traverse(GameObject obj, JEGameObject jparent = null)
        {
            JEGameObject jgo = new JEGameObject(obj, jparent);

            foreach (Transform child in obj.transform)
            {
                Traverse(child.gameObject, jgo);
            }

            return(jgo);
        }
コード例 #4
0
ファイル: JEGameObject.cs プロジェクト: Cucala/code-1
        public JEGameObject(GameObject go, JEGameObject parent)
        {
            GameObjectLookup[go] = this;
            this.unityGameObject = go;

            this.parent = parent;
            this.name   = go.name;

            if (parent != null)
            {
                parent.children.Add(this);
            }

            JEComponent.QueryComponents(this);
        }