Example #1
0
        public AssetBUTN(Game game, string assetName, Vector3 position, AssetTemplate template) : base(assetName, AssetType.BUTN, BaseAssetType.Button, position)
        {
            this.game = game;

            if (template == AssetTemplate.Button_Red)
            {
                Model_AssetID        = "button";
                PressedModel_AssetID = "button_grn";
                HitMask.FlagValueInt =
                    2 << 0 |
                        2 << 3 |
                        2 << 4 |
                        2 << 6 |
                        2 << 7 |
                        2 << 14 |
                        2 << 15;
                Motion = new Motion_Mechanism()
                {
                    MovementType     = EMovementType.SlideAndRotate,
                    MovementLoopMode = EMechanismFlags.ReturnToStart,
                    SlideAxis        = Axis.Y,
                    SlideDistance    = -0.2f,
                    SlideTime        = 0.5f,
                    SlideDecelTime   = 0.2f
                };
                Motion.MotionFlags.FlagValueInt = 4;
            }
            else if (template == AssetTemplate.PressurePlate)
            {
                ActMethod            = ButnActMethod.PressurePlate;
                Model_AssetID        = "plate_pressure";
                PressedModel_AssetID = 0xCE7F8131;
                HitMask.FlagValueInt =
                    2 << 10 |
                        2 << 12 |
                        2 << 13 |
                        2 << 16;
                Motion = new Motion_Mechanism()
                {
                    MovementType     = EMovementType.SlideAndRotate,
                    MovementLoopMode = EMechanismFlags.ReturnToStart,
                    SlideAxis        = Axis.Y,
                    SlideDistance    = -0.15f,
                    SlideTime        = 0.15f,
                };
                Motion.MotionFlags.FlagValueInt = 4;
            }
            else
            {
                Motion = new Motion_Mechanism();
            }
        }
Example #2
0
        public AssetBUTN(Section_AHDR AHDR, Game game, Endianness endianness) : base(AHDR, game, endianness)
        {
            using (var reader = new EndianBinaryReader(AHDR.data, endianness))
            {
                reader.BaseStream.Position = entityHeaderEndPosition;

                if (game != Game.Scooby)
                {
                    PressedModel_AssetID = reader.ReadUInt32();
                }
                ActMethod            = (ButnActMethod)reader.ReadInt32();
                InitialButtonState   = reader.ReadInt32();
                ResetAfterDelay      = reader.ReadInt32Bool();
                ResetDelay           = reader.ReadSingle();
                HitMask.FlagValueInt = reader.ReadUInt32();
                Motion = new Motion_Mechanism(reader, game);
            }
        }
Example #3
0
 public AssetWithMotion(Section_AHDR AHDR) : base(AHDR)
 {
     _motion = new Motion_Mechanism(Data.Skip(MotionStart).ToArray());
 }