示例#1
0
        private static void UpdateData()
        {
            //Debug.Log("Hello There");
            GameObject[] gameObjects = FindObjectsOfType <GameObject>();

            foreach (GameObject gameObject in gameObjects)
            {
                if (gameObject.name == "ThirdPersonController" /* && component is Collider*/)
                {
                    continue;
                }

                //Debug.Log("Hello There1");
                var components = gameObject.GetComponents <Component>();
                foreach (Component component in components)
                {
                    if (component == null)
                    {
                        Debug.Log("Null Component!?");
                    }
                    //Debug.Log("Hello There2");
                    if (gameObject.name == "ThirdPersonController" /* && component is Collider*/)
                    {
                        continue;
                    }
                    if (gameObject.name.Contains("plate") && (component is Collider /* || component is MeshFilter*/))
                    {
                        continue;
                    }
                    if (component != null && GameObject_.Contains(component.GetType()))
                    {
                        //Debug.Log("Hello There3");
                        Type       ourType      = GameObject_.GetSerializableForm(component.GetType());
                        Component_ ourComponent = gameObject.GetComponent(ourType) as Component_;
                        if (ourComponent == null)
                        {
                            ourComponent = gameObject.AddComponent(ourType) as Component_;
                        }

                        if (ourComponent != null)
                        {
                            ourComponent.UpdateID();
                            ourComponent.UpdateData(component);
                        }
                        else
                        {
                            Debug.Log("ERROR");
                        }
                    }
                }


                GameObject_ go_ = gameObject.GetComponent <GameObject_>();
                if (!go_)
                {
                    go_ = gameObject.AddComponent <GameObject_>();
                }
                go_.UpdateID();
                go_.UpdateData(null);
            }

            Transform_.count = 0;
            //GameObject_.CallLate();
        }
示例#2
0
        public abstract void UpdateData(UnityEngine.Object unityObject);// where T : UnityEngine.Object;

        public void UpdateID()
        {
            typeID = GameObject_.GetID(GetType());
        }