protected override void SafeAwake() { RotationKey = new MKey("旋转", "Rotation", KeyCode.R); RotationKey.KeysChanged += ChangedProperties; CurrentMapperTypes.Add(RotationKey); LockedToggle = new MToggle("锁定旋转", "Locked", Locked); LockedToggle.Toggled += (bool value) => { Locked = value; ChangedProperties(); }; CurrentMapperTypes.Add(LockedToggle); LerpSlider = new MSlider("插值", "Lerp", Lerp, 0f, 20f, false); LerpSlider.ValueChanged += (float value) => { Lerp = value; ChangedProperties(); }; CurrentMapperTypes.Add(LerpSlider); #if DEBUG ConsoleController.ShowMessage("自转块添加进阶属性"); #endif }
protected override void SafeAwake() { SwitchKey = new MKey("气动开关", "Switch", KeyCode.O); SwitchKey.KeysChanged += ChangedProperties; CurrentMapperTypes.Add(SwitchKey); HardnessMenu = new MMenu("", Hardness, WoodHardness, false); HardnessMenu.ValueChanged += (int value) => { Hardness = value; ChangedProperties(); }; CurrentMapperTypes.Add(HardnessMenu); EffectToggle = new MToggle("初始生效", "Effect", Effect); EffectToggle.Toggled += (bool value) => { Effect = value; ChangedProperties(); }; CurrentMapperTypes.Add(EffectToggle); #if DEBUG ConsoleController.ShowMessage("桨叶添加进阶属性"); #endif }
protected override void SafeAwake() { BrakeKey = new MKey("刹车", "Brake", KeyCode.None); BrakeKey.KeysChanged += ChangedProperties; CurrentMapperTypes.Add(BrakeKey); BrakeForceSlider = new MSlider("刹车力度", "BrakeForce", BrakeForce, 0, 5, false); BrakeForceSlider.ValueChanged += (float value) => { BrakeForce = value; ChangedProperties(); }; CurrentMapperTypes.Add(BrakeForceSlider); ColliderToggle = new MToggle("自定碰撞", "Collider", Collider); ColliderToggle.Toggled += (bool value) => { Collider = value; ChangedProperties(); }; CurrentMapperTypes.Add(ColliderToggle); FrictionToggle = new MToggle("自定摩擦", "FrictionT", FrictionT); FrictionToggle.Toggled += (bool value) => { FrictionT = FrictionSlider.DisplayInMapper = value; ChangedProperties(); }; CurrentMapperTypes.Add(FrictionToggle); FrictionSlider = new MSlider("摩擦力", "Friction", Friction, 0f, 1f, false); FrictionSlider.ValueChanged += (float value) => { Friction = value; ChangedProperties(); }; CurrentMapperTypes.Add(FrictionSlider); if (BB.BlockID == (int)BlockType.Wheel || BB.BlockID == (int)BlockType.LargeWheel) { if (BB.BlockID == (int)BlockType.Wheel) { Lerp = 16; } else { Lerp = 8; } LerpSlider = new MSlider("插值", "Lerp", Lerp, 0f, 30f, false); LerpSlider.ValueChanged += (float value) => { Lerp = value; ChangedProperties(); }; CurrentMapperTypes.Add(LerpSlider); } #if DEBUG ConsoleController.ShowMessage("动力组件添加进阶属性"); #endif }