protected override async Task OnActivatedAsync(ActorActivationDetails details) { BridgeType type = (BridgeType)details.Params[0]; canBeFrozen = false; await RequestMetadataAsync("Bridge/" + type.ToString("G")); SetAnimation("Piece"); int variations = currentAnimation.FrameCount; if (variations > 0) { ushort idx = details.Params[1]; renderer.AnimFirstFrame = idx % variations; } collisionFlags = CollisionFlags.CollideWithOtherActors | CollisionFlags.IsSolidObject | CollisionFlags.SkipPerPixelCollisions; IsOneWay = true; }
public override void OnAttach(ActorInstantiationDetails details) { base.OnAttach(details); BridgeType type = (BridgeType)details.Params[0]; canBeFrozen = false; RequestMetadata("Bridge/" + type.ToString("G")); SetAnimation("Piece"); int variations = currentAnimation.FrameCount; if (variations > 0) { ushort idx = details.Params[1]; renderer.AnimFirstFrame = idx % variations; } collisionFlags = CollisionFlags.CollideWithOtherActors | CollisionFlags.IsSolidObject | CollisionFlags.SkipPerPixelCollisions; IsOneWay = true; }