Пример #1
0
        void UpdateMeshEmitterEntity()
        {
            if (!HasEngineInstance())
            {
                return;
            }

            EngineInstanceEntity _inst = null;

            if (_emitterMeshEntity != null && _emitterMeshEntity.Shape != null)
            {
                IEngineShapeInstance targetShapeInstance = _emitterMeshEntity.Shape._engineInstance;

                // Only IEngineShapeInstance that are also EngineInstanceEntity are accepted
                if (targetShapeInstance == null || targetShapeInstance is EngineInstanceEntity)
                {
                    _inst = targetShapeInstance as EngineInstanceEntity;
                }
                else
                {
                    _emitterMeshEntity = null;
                }
            }
            EnginePGroup.SetMeshEmitterEntity(_inst);
        }
Пример #2
0
        public override void RemoveEngineInstance(bool bRemoveChildren)
        {
            IEngineShapeInstance keepAlive = _engineInstance;

            _engineInstance = null;

            base.RemoveEngineInstance(bRemoveChildren);

            _engineInstance = keepAlive;
        }
Пример #3
0
        public override void RemoveEngineInstance(bool bRemoveChildren)
        {
            IEngineShapeInstance keepAlive = _engineInstance;

            if (Parent is UIShapeDialog)
            {
                ((UIShapeDialog)Parent).RemoveUIControlInstance(this);
            }

            _engineInstance = null;

            base.RemoveEngineInstance(bRemoveChildren);
        }
Пример #4
0
        public override void RemoveEngineInstance(bool bRemoveChildren)
        {
            // The editing context holds a reference to the shape, so we need to close it first (such as when undoing before finishing the shape)
            if (EditorManager.ActiveView.CurrentContext is AddVolumeVertexContext)
            {
                EditorManager.ActiveView.SetDefaultContext();
            }

            IEngineShapeInstance keepAlive = _engineInstance;

            _engineInstance = null;

            base.RemoveEngineInstance(bRemoveChildren);

            _engineInstance = keepAlive;
        }
Пример #5
0
        public override void RemoveEngineInstance(bool bRemoveChildren)
        {
            // only unload if the part of the zone unload, otherwise unload when removed from scene which should catch all other possibilities
            if (this.ParentZone != null && this.ParentZone.CurrentStatus == Zone.ZoneStatus.Unloading)
            {
                base.RemoveEngineInstance(bRemoveChildren);
            }

            // pretend that we have no instance to keep the instance. It is removed in OnRemoveFromScene
            IEngineShapeInstance _keepInst = _engineInstance;

            _engineInstance = null;

            base.RemoveEngineInstance(bRemoveChildren);

            _engineInstance = _keepInst;
        }
        public override void DragLeave()
        {
            if (_instance != null)
              {
            _instance.Dispose();
            _instance = null;
              }

              if (_dummyShape != null)
              {
            _dummyShape.Dispose();
            _dummyShape = null;
              }
              EditorManager.ActiveView.UpdateView(false);
        }
        private void createInstance(System.Windows.Forms.DragEventArgs e)
        {
            _assetPaths = CSharpFramework.Contexts.IDropContext.GetAssetPaths(e);
              _assetTypes = CSharpFramework.Contexts.IDropContext.GetAssetTypes(e);
              _assetNames = CSharpFramework.Contexts.IDropContext.GetAssetNames(e);

              Debug.Assert(_assetPaths.Length == _assetTypes.Length && _assetPaths.Length == _assetNames.Length);
              if (_assetPaths.Length == 0)
            return;

              if (_assetTypes[0] == "Model")
              {
            _instance = new EngineInstanceEntity("VisBaseEntity_cl", _assetPaths[0], null, null, true);
              }
              else if (_assetTypes[0] == "StaticMesh")
              {
            EngineInstanceStaticMesh instance = new EngineInstanceStaticMesh();
            instance.SetMeshFile(_assetPaths[0], "", 0, false);
            instance.SetCollisionBitmask(0);
            _instance = instance;
              }
              else if (_assetTypes[0] == "Prefab")
              {
            EngineInstancePrefab instance = new EngineInstancePrefab();
            instance.SetFilename(_assetPaths[0]);
            _instance = instance;
              }
        }
        private void createInstance(System.Windows.Forms.DragEventArgs e)
        {
            _assetPaths = CSharpFramework.Contexts.IDropContext.GetAssetPaths(e);
              _assetTypes = CSharpFramework.Contexts.IDropContext.GetAssetTypes(e);
              _assetNames = CSharpFramework.Contexts.IDropContext.GetAssetNames(e);

              Debug.Assert(_assetPaths.Length == _assetTypes.Length && _assetPaths.Length == _assetNames.Length);
              if (_assetPaths.Length == 0)
            return;

              if (_assetTypes[0] == "Model")
              {
            _instance = new EngineInstanceEntity("VisBaseEntity_cl", _assetPaths[0], null, null, true);
              }
              else if (_assetTypes[0] == "StaticMesh")
              {
            EngineInstanceStaticMesh instance = new EngineInstanceStaticMesh();
            LODEntry lodEntry = new LODEntry();
            lodEntry._filename = _assetPaths[0];
            List<LODEntry> lodEntries = new List<LODEntry>();
            lodEntries.Add(lodEntry);
            instance.SetLODChain(lodEntries);
            _instance = instance;
              }
              else if (_assetTypes[0] == "Prefab")
              {
            EngineInstancePrefab instance = new EngineInstancePrefab();
            instance.SetFilename(_assetPaths[0]);
            _instance = instance;
              }
        }