// internal AnimationItem(MeshObjectAnimationController owner, string animationBaseName, bool allowRandomAnimationNumber, bool loop) { this.owner = owner; this.animationBaseName = animationBaseName; this.allowRandomAnimationNumber = allowRandomAnimationNumber; this.loop = loop; }
/// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnShouldDelete()"/>.</summary> protected override bool OnShouldDelete() { animationController = null; return base.OnShouldDelete(); }
/// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnDestroy()"/>.</summary> protected override void OnDestroy() { animationController = null; if( EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle() ) { if( PhysicsModel != null ) { if( Type.ImpulseDamageCoefficient != 0 || Type.SoundCollision != null ) { foreach( Body body in PhysicsModel.Bodies ) body.Collision -= Body_Collision; } } } base.OnDestroy(); }
void CreateAnimationController() { MapObjectAttachedMesh attachedMesh = null; foreach( MapObjectAttachedObject attachedObject in AttachedObjects ) { attachedMesh = attachedObject as MapObjectAttachedMesh; if( attachedMesh != null ) break; } if( attachedMesh == null ) return; MeshObject meshObject = attachedMesh.MeshObject; if( meshObject == null ) return; if( meshObject.AnimationStates == null ) return; animationController = new MeshObjectAnimationController( meshObject, animationsBlendingTime ); }
// internal AnimationItem( MeshObjectAnimationController owner, string animationBaseName, bool allowRandomAnimationNumber, bool loop ) { this.owner = owner; this.animationBaseName = animationBaseName; this.allowRandomAnimationNumber = allowRandomAnimationNumber; this.loop = loop; }