Esempio n. 1
0
 public void OnTargetReferenceReadded(ShapeReference shaperef)
 {
     if (!object.ReferenceEquals(shaperef, _emitterMeshEntity))
     {
         return;
     }
     UpdateMeshEmitterEntity();
 }
Esempio n. 2
0
 public void OnTargetReferenceRemoved(ShapeReference shaperef)
 {
     if (!object.ReferenceEquals(shaperef, _emitterMeshEntity))
     {
         return;
     }
     shaperef.CachedShape = null; // make sure the shape is not set anymore
     UpdateMeshEmitterEntity();
 }
 public void OnTargetReferenceReadded(ShapeReference shaperef)
 {
     // Check if we need to update the mesh emitter entity.
     if (!object.ReferenceEquals(shaperef, _emitterMeshEntity))
     {
         return;
     }
     UpdateMeshEmitterEntity();
 }
Esempio n. 4
0
 /// <summary>
 /// Called when deserializing
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected ParticleGroupShape(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     _effectFile = info.GetString("_effectFile");
     if (SerializationHelper.HasElement(info, "_iVisibleBitmask"))
     {
         _iVisibleBitmask = (FlagsInt32_e)info.GetValue("_iVisibleBitmask", typeof(FlagsInt32_e));
     }
     if (SerializationHelper.HasElement(info, "_effectKey"))
     {
         _objectKey = info.GetString("_effectKey"); // assign to new object key
     }
     if (SerializationHelper.HasElement(info, "_ambientColor"))
     {
         _ambientColor = (Color)info.GetValue("_ambientColor", typeof(Color));
     }
     if (SerializationHelper.HasElement(info, "_bPaused"))
     {
         _bPaused = info.GetBoolean("_bPaused");
     }
     if (SerializationHelper.HasElement(info, "_bHalted"))
     {
         _bHalted = info.GetBoolean("_bHalted");
     }
     if (SerializationHelper.HasElement(info, "_bApplyTimeOfDayLighting"))
     {
         _bApplyTimeOfDayLighting = info.GetBoolean("_bApplyTimeOfDayLighting");
     }
     if (SerializationHelper.HasElement(info, "_uiRandomBaseSeed"))
     {
         _uiRandomBaseSeed = (uint)info.GetValue("_uiRandomBaseSeed", typeof(uint));
     }
     if (SerializationHelper.HasElement(info, "_windSpeed"))
     {
         _windSpeed = (Vector3F)info.GetValue("_windSpeed", typeof(Vector3F));
     }
     if (SerializationHelper.HasElement(info, "_bLocalSpaceWind"))
     {
         _bLocalSpaceWind = info.GetBoolean("_bLocalSpaceWind");
     }
     if (SerializationHelper.HasElement(info, "_fIntensity"))
     {
         _fIntensity = info.GetSingle("_fIntensity");
     }
     if (SerializationHelper.HasElement(info, "_emitterMeshEntity"))
     {
         _emitterMeshEntity = (ShapeReference)info.GetValue("_emitterMeshEntity", typeof(ShapeReference));
     }
     if (_emitterMeshEntity != null)
     {
         _emitterMeshEntity.Owner = this; // old files
     }
 }
 /// <summary>
 /// Called when deserializing
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected ParticleGroupShape(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _effectFile = info.GetString( "_effectFile" );
       if (SerializationHelper.HasElement(info,"_iVisibleBitmask"))
     _iVisibleBitmask = (FlagsInt32_e)info.GetValue("_iVisibleBitmask", typeof(FlagsInt32_e));
       if (SerializationHelper.HasElement(info, "_iLightInfluenceBitmask"))
     _iLightInfluenceBitmask = (FlagsInt32_e)info.GetValue("_iLightInfluenceBitmask", typeof(FlagsInt32_e));
       if (SerializationHelper.HasElement(info, "_preferredDynamicDirLightKey"))
     _preferredDynamicDirLightKey = info.GetString("_preferredDynamicDirLightKey");
       if (SerializationHelper.HasElement(info, "_lightSamplingOffset"))
     _lightSamplingOffset = (Vector3F)info.GetValue("_lightSamplingOffset", typeof(Vector3F));
       if (SerializationHelper.HasElement(info,"_effectKey"))
     _objectKey = info.GetString("_effectKey"); // assign to new object key
       if (SerializationHelper.HasElement(info, "_ambientColor"))
     _ambientColor = (Color)info.GetValue("_ambientColor", typeof(Color));
       if (SerializationHelper.HasElement(info, "_bPaused"))
     _bPaused = info.GetBoolean("_bPaused");
       if (SerializationHelper.HasElement(info, "_bHalted"))
     _bHalted = info.GetBoolean("_bHalted");
       if (SerializationHelper.HasElement(info, "_bApplyTimeOfDayLighting"))
     _bApplyTimeOfDayLighting = info.GetBoolean("_bApplyTimeOfDayLighting");
       if (SerializationHelper.HasElement(info, "_uiRandomBaseSeed"))
     _uiRandomBaseSeed = (uint)info.GetValue("_uiRandomBaseSeed", typeof(uint));
       if (SerializationHelper.HasElement(info, "_windSpeed"))
     _windSpeed = (Vector3F)info.GetValue("_windSpeed", typeof(Vector3F));
       if (SerializationHelper.HasElement(info, "_bLocalSpaceWind"))
     _bLocalSpaceWind = info.GetBoolean("_bLocalSpaceWind");
       if (SerializationHelper.HasElement(info, "_fIntensity"))
     _fIntensity = info.GetSingle("_fIntensity");
       if (SerializationHelper.HasElement(info, "_emitterMeshEntity"))
     _emitterMeshEntity = (ShapeReference)info.GetValue("_emitterMeshEntity", typeof(ShapeReference));
       if (_emitterMeshEntity != null)
     _emitterMeshEntity.Owner = this; // old files
 }
        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);
        }
 public void OnTargetReferenceRemoved(ShapeReference shaperef)
 {
     // Check if we need to update the mesh emitter entity.
       if (!object.ReferenceEquals(shaperef, _emitterMeshEntity))
     return;
       shaperef.CachedShape = null; // make sure the shape is not set anymore
       UpdateMeshEmitterEntity();
 }
 public void OnTargetReferenceReadded(ShapeReference shaperef)
 {
     // Check if we need to update the mesh emitter entity.
       if (!object.ReferenceEquals(shaperef, _emitterMeshEntity))
     return;
       UpdateMeshEmitterEntity();
 }
 public void OnTargetReferenceReadded(ShapeReference shaperef)
 {
     if (!object.ReferenceEquals(shaperef, _emitterMeshEntity))
     return;
       UpdateMeshEmitterEntity();
 }
Esempio n. 10
0
 void UpdateShapeReference(ShapeReference shaperef)
 {
     if (!HasEngineInstance() || _entityProperties == null)
     return;
       foreach (DynamicProperty prop in _entityProperties.Properties)
     if (object.ReferenceEquals(prop.Value, shaperef))
     {
       string varValue = SerializationHelper.GetEngineStringFromObject(prop.Value);
       EngineEntity.SetVariable(prop.PropertyType.Name, varValue);
     }
 }
Esempio n. 11
0
 public void OnTargetReferenceRemoved(ShapeReference shaperef)
 {
     shaperef.CachedShape = null;
       UpdateShapeReference(shaperef);
 }
Esempio n. 12
0
 public void OnTargetReferenceReadded(ShapeReference shaperef)
 {
     UpdateShapeReference(shaperef);
 }