public static IBinaryMessage Compose(SizeData sizeData) { return(BinaryMessage.Compose(Name, writer => { writer.Write((int)sizeData.Size.Width); writer.Write((int)sizeData.Size.Height); writer.Write((double)sizeData.Density); })); }
public void Resize(SizeData sizeData) { _unoSize = sizeData.Size * sizeData.Density; _unoDensity = sizeData.Density; SetFrameSize(sizeData.Size.ToSize()); _unoWindow.ChangeSize(_unoSize, _unoDensity); _size.OnNext(sizeData.Size); Reshape(); }
private IEnumerator LoadOriginalSizeImage(string imageURL) { using (WWW www = new WWW(imageURL)) { yield return(www); string textToDeserialize = www.text; SizeObject sizeObject = JsonConvert.DeserializeObject <SizeObject>(textToDeserialize); SizeData sizeData = sizeObject.sizes.size.Find(item => item.label == originalSizeHeader); imageOriginalSize = new Vector2(Convert.ToInt32(sizeData.width) / scaleFactor, Convert.ToInt32(sizeData.height) / scaleFactor); } }
/// <summary>Display the error and sound error that the player cannot change here.</summary> public void FailToChange(ShapeData shapeData, Vector2 targetPos) { // Get the rotation from the facing direction and the current shape direction Vector2Int facingDir = playerMoveRef.GetFacingDirection(); float shapeRot = GetShapeRotation(shapeData, facingDir, shapeData != prevShapeData); // Set size Vector2Int size = shapeData.Scale; if (curSizeData != null) { size *= curSizeData.Size; } // Display cannot fit here error ShowCannotFitHere(shapeData.TypeOfShape, targetPos, size, shapeRot); // Play cannot fit sound failedTransformSound.Play(); // Revert shape and size data to their previous states curShapeData = prevShapeData; curSizeData = prevSizeData; }
public SizeAPI() { _service = new Service(); _js = new JavaScriptSerializer(); _sizeData = new SizeData(); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="size">畑のサイズ</param> public SetFarmSizeSettingCommand(SizeData size) { m_FarmSize = size; }
public static void SizeToolsGUI(AnimBool showTools, IPlatformLayerSpatialData platform, IPlatformLayerTiles tiles, SizeData roomSize) { if (SizeToolsGUI(showTools, out var mod, false) != ChangeCheck.Changed) { return; } ApplySizeTool(platform, tiles, roomSize, mod); }
/// <summary> /// 設定変更ボタンクリックイベント /// </summary> /// <param name="sender">sender</param> /// <param name="e">e</param> private void btnSettingChange_Click(object sender, EventArgs e) { SettingData setting = SettingData.GetInstance(); DoubleText verticalText = null; DoubleText horizontalText = null; verticalText = (DoubleText)pnlSetting.Controls[0]; horizontalText = (DoubleText)pnlSetting.Controls[1]; if ((verticalText.Value != setting.RobotSize.Vertical) || (horizontalText.Value != setting.RobotSize.Horizontal)) { SizeData size = new SizeData(); size.Vertical = verticalText.Value; size.Horizontal = horizontalText.Value; SetRobotSizeSettingCommand command = new SetRobotSizeSettingCommand(size); command.OnAnalyzed += evRobotSizeSettingChanged; usrCommControl.Send(command); } verticalText = (DoubleText)pnlSetting.Controls[2]; horizontalText = (DoubleText)pnlSetting.Controls[3]; if ((verticalText.Value != setting.FarmSize.Vertical) || (horizontalText.Value != setting.FarmSize.Horizontal)) { SizeData size = new SizeData(); size.Vertical = verticalText.Value; size.Horizontal = horizontalText.Value; SetFarmSizeSettingCommand command = new SetFarmSizeSettingCommand(size); command.OnAnalyzed += evFarmSizeSettingChanged; usrCommControl.Send(command); } if ((setting.KusakariStart.DayOfWeek != (DateTimeSetting.DayOfWeekEnum)usrKusakariStart.DayOfWeek) || (setting.KusakariStart.Hour != usrKusakariStart.Hour) || (setting.KusakariStart.Minulte != usrKusakariStart.Minute)) { DateTimeSetting dt = new DateTimeSetting(); dt.DayOfWeek = (DateTimeSetting.DayOfWeekEnum)usrKusakariStart.DayOfWeek; dt.Hour = usrKusakariStart.Hour; dt.Minulte = usrKusakariStart.Minute; SetStartTimeSettingCommand command = new SetStartTimeSettingCommand(SetStartTimeSettingCommand.ModeEnum.Kusakari, dt); command.OnAnalyzed += evKusakariStartSettingChanged; usrCommControl.Send(command); } if ((setting.YakeiStart.DayOfWeek != (DateTimeSetting.DayOfWeekEnum)usrYakeiStart.DayOfWeek) || (setting.YakeiStart.Hour != usrYakeiStart.Hour) || (setting.YakeiStart.Minulte != usrYakeiStart.Minute)) { DateTimeSetting dt = new DateTimeSetting(); dt.DayOfWeek = (DateTimeSetting.DayOfWeekEnum)usrYakeiStart.DayOfWeek; dt.Hour = usrYakeiStart.Hour; dt.Minulte = usrYakeiStart.Minute; SetStartTimeSettingCommand command = new SetStartTimeSettingCommand(SetStartTimeSettingCommand.ModeEnum.Yakei, dt); command.OnAnalyzed += evYakeiStartSettingChanged; usrCommControl.Send(command); } FloatText moveEndRateText = (FloatText)pnlSetting.Controls[4]; float rate = moveEndRateText.Value / 100.0F; if (setting.MoveEndRate != rate) { SetMoveEndRateCommand command = new SetMoveEndRateCommand(rate); command.OnAnalyzed += evMoveEndRateSettingChanged; usrCommControl.Send(command); } }
/// <summary> /// コンストラクタ /// </summary> /// <param name="size">ロボットサイズ</param> public SetRobotSizeSettingCommand(SizeData size) { m_RobotSize = size; }
/* ============================================================================ Init functions ============================================================================ */ public void Init() { // first init languages languages = new LanguageData(); statusValues = new StatusValueData(); elements = new ElementData(); races = new RaceData(); sizes = new SizeData(); areaNames = new AreaNameData(); armors = new ArmorData(); cameraPositions = new CameraPositionData(); attacks = new BaseAttackData(); characters = new CharacterData(); classes = new ClassData(); colors = new ColorData(); dialoguePositions = new DialoguePositionData(); battleAIs = new BattleAIData(); enemies = new EnemyData(); equipParts = new EquipmentPartData(); formulas = new FormulaData(); gameSettings = new GameSettingsData(); items = new ItemData(); itemTypes = new ItemTypeData(); loadSaveHUD = new LoadSaveHUDData(); mainMenu = new MainMenuData(); skillTypes = new SkillTypeData(); effects = new StatusEffectData(); skills = new SkillData(); weapons = new WeaponData(); music = new MusicData(); huds = new HUDData(); recipes = new ItemRecipeData(); fonts = new FontData(); globalEvents = new GlobalEventData(); teleports = new TeleportData(); difficulties = new DifficultyData(); // battle system battleAnimations = new BattleAnimationData(); battleSystem = new BattleSystemData(); }