示例#1
0
            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;
            }
示例#2
0
文件: Bridge.cs 项目: fossabot/jazz2
            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;
            }