public override bool InternalLoad()
        {
            base.InternalLoad();

            _renderComponent = GameObject.Components.FirstOrDefault(c => c is MeshRenderComponent) as MeshRenderComponent;
            _meshComponent = GameObject.Components.FirstOrDefault(c => c is MeshComponent) as MeshComponent;
            _rigidBodyComponent = GameObject.Components.FirstOrDefault(c => c is RigidBodyBaseComponent) as RigidBodyBaseComponent;

            /* loaded if textcomponent is found */
            return _renderComponent != null && _meshComponent != null;
        }
Esempio n. 2
0
        private void UpdateCompositionCache()
        {
            if (!_compositionChanged) return;

            _renderComponent = Components.FirstOrDefault(c => c is RenderComponent && c.IsLoaded) as RenderComponent;
            _rigidBodyComponent = Components.FirstOrDefault(c => c is RigidBodyBaseComponent) as RigidBodyBaseComponent;
            _childrenArray = _children.ToArray();
            _componentArray = _components.ToArray();

            _compositionChanged = false;
        }