Exemple #1
0
        // Give some random GUID on awake in case we aren't setting this thing up from a proxy.
        private void Awake()
        {
            m_Guid = ProxyWorld.CreateGuid();
            VirtualAwake();

            ComponentList.OnStart(this);
        }
Exemple #2
0
            public virtual void Unload(GameObject go)
            {
                // save relevant data for this gameobject before we purge it
                // @TEMP
                m_Bounds   = new Bounds(go.transform.position, new Vector3(5.0f, 5.0f));
                m_Scale    = go.transform.localScale;
                m_Position = go.transform.position;
                m_Rotation = go.transform.rotation;
                m_Guid     = go.GetComponent <Proxied>().Guid;
                m_Level    = go.GetComponent <Proxied>().Level;
                m_RandSeed = go.GetComponent <Proxied>().m_RandSeed;
                if (m_Guid == null || m_Guid.Length == 0)
                {
                    m_Guid = ProxyWorld.CreateGuid();
                }

                // Generate proxy data for each component
                foreach (var comp in go.GetComponents <IProxy>())
                {
                    var data = comp.CreateData();
                    data.Unload(go);
                    m_Data.Add(data);
                }
            }