protected void AddColumns() { ColumnDefinitions.Clear(); Children.Clear(); ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(Width / 20d) }); //Alert signal //ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(Width / 20d)}); //Source //ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(Width / 20d)}); //Type ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(Width * (2 / 20d)) }); //ID ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(Width * (2 / 20d)) }); //MID ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(Width * (9d / 20d)) }); //Component ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(Width * (4d / 20d)) }); //Mode string ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(Width * (2d / 20d)) }); //Time Stamp AddAlertSignal(); //AddColumn(ref SourceBlock, message.SourceString, 1); //AddColumn(ref TypeBlock, message.TypeString, 2); AddColumn(ref IDBlock, message.IDString, 1); AddColumn(ref MIDBlock, message.MidString, 2); AddColumn(ref ComponentBlock, message.Component, 3); AddColumn(ref ModeBlock, message.FmiString, 4); AddColumn(ref DateBlock, message.TimeStamp.ToString("h:mm"), 5); //AddButton(); //SourceBlock.ScaleText(Width / 20d, Height); //TypeBlock.ScaleText(Width / 20d, Height); IDBlock.ScaleText(Width / 20d, Height); MIDBlock.ScaleText(Width / 20d, Height); ComponentBlock.ScaleText(Width * (9d / 20d), Height); ModeBlock.ScaleText(Width * (5d / 20d), Height); DateBlock.ScaleText(Width * (3d / 20d), Height); Children.BalanceTextBlocks(); }
private void AddShipComponent(ComponentBlock component) { GameObject gObject = Instantiate(component.component,component.transform.position,component.transform.rotation) as GameObject; gObject.transform.SetParent(transform); existingComponents.Add (new ComponentBlock (gObject.transform,gObject,component.type)); }