/// <summary> /// Creates a customization containing a single matte color. /// </summary> /// <param name="mainColor">The color applied to the front and back of the car.</param> public CarCustomization(Color mainColor) { this.FrontColor = new SerializableColor(mainColor); this.IsFrontShiny = false; this.BackColor = new SerializableColor(mainColor); this.IsBackShiny = false; }
void SetHistoricTailSegments() { List <Player> historicPlayers = gameStateManager.gameStateData.historicPlayers; for (int i = 0; i < historicPlayers.Count; i++) { if (i == 0) { GameObject tailSegment = Instantiate(tailSegmentPrefab, FirstTailSegmentTarget.transform.position, Quaternion.identity); tailSegments.Add(tailSegment); tailSegment.GetComponent <TailSegmentController>().Target = FirstTailSegmentTarget; SpriteRenderer tailSprite = tailSegment.GetComponent <SpriteRenderer>(); SerializableColor historicColor = historicPlayers[i].color; tailSprite.color = new Color(historicColor.r, historicColor.g, historicColor.b, historicColor.a); } else { GameObject tailSegment = Instantiate(tailSegmentPrefab, tailSegments[i - 1].GetComponentInChildren <Transform>().position, Quaternion.identity); tailSegments.Add(tailSegment); tailSegment.GetComponent <TailSegmentController>().Target = tailSegments[i - 1].GetComponentInChildren <Transform>().gameObject; SpriteRenderer tailSprite = tailSegment.GetComponent <SpriteRenderer>(); SerializableColor historicColor = historicPlayers[i].color; tailSprite.color = new Color(historicColor.r, historicColor.g, historicColor.b, historicColor.a); } } }
public void Initialize() { theme = 0; if (objectList != null) { Debug.Log("Salut"); objectList.Clear(); } objectList = new List <List <List <Tile> > >(); for (int i = 0; i < LevelManager.Instance.mapSize.x / 10; i++) { objectList.Add(new List <List <Tile> >()); for (int j = 0; j < LevelManager.Instance.mapSize.y / 10; j++) { objectList[i].Add(new List <Tile>()); } } colorScheme = new SerializableColor[8][]; for (int i = 0; i < colorScheme.Length; i++) { colorScheme[i] = new SerializableColor[2]; for (int k = 0; k < colorScheme[i].Length; k++) { colorScheme[i][k] = new SerializableColor(); } } }
public static TextField ParseColorRect(string s) { if (!s.Contains("colorRect:")) { throw new FormatException("[ProceduralObjects] TextField Parse : Input string was not in the correct format"); } try { TextField f = new TextField(1); bool includesborder = s.Contains(" m_borderSize:"); f.x = float.Parse(s.GetStringBetween(" m_x:", " m_y:")); f.y = float.Parse(s.GetStringBetween(" m_y:", " m_width:")); f.m_width = uint.Parse(s.GetStringBetween(" m_width:", " m_height:")); f.m_height = uint.Parse(s.GetStringBetween(" m_height:", includesborder ? " m_borderSize:" : " m_color:")); if (includesborder) { f.borderSize = byte.Parse(s.GetStringBetween(" m_borderSize:", " m_borderColor:")); f.borderColor = SerializableColor.Parse(s.GetStringBetween(" m_borderColor:", " m_color:")); } f.m_fontColor = SerializableColor.Parse(s.GetStringAfter(" m_color:")); return(f); } catch (Exception e) { Debug.LogError("[ProceduralObjects] Error : " + e.GetType().ToString() + " while parsing a TextField : " + e.Message); return(new TextField(0)); } }
public SerializableColor(SerializableColor color) { R = color.R; G = color.G; B = color.B; A = color.A; }
public static TextField ParseText(string s, FontManager fManager) { if (!s.Contains("textParam:")) { throw new FormatException("[ProceduralObjects] TextField Parse : Input string was not in the correct format"); } try { TextField f = new TextField(0); bool newVersion = s.Contains(" m_rotation:"); f.SetFont(s.GetStringBetween(" m_font:", " m_size:"), fManager); f.m_fontSize = uint.Parse(s.GetStringBetween(" m_size:", " m_spacing:")); f.m_spacing = uint.Parse(s.GetStringBetween(" m_spacing:", " m_style:")); f.m_style = TextCustomizationManager.IntToStyle(int.Parse(s.GetStringBetween(" m_style:", " m_x:"))); f.x = float.Parse(s.GetStringBetween(" m_x:", " m_y:")); f.y = float.Parse(s.GetStringBetween(" m_y:", " m_scaleX:")); f.m_scaleX = float.Parse(s.GetStringBetween(" m_scaleX:", " m_scaleY:")); f.m_scaleY = float.Parse(s.GetStringBetween(" m_scaleY:", newVersion ? " m_rotation:" : " m_fontcolor:")); if (newVersion) { f.m_rotation = byte.Parse(s.GetStringBetween(" m_rotation:", " m_fontcolor:")); } f.m_fontColor = SerializableColor.Parse(s.GetStringBetween(" m_fontcolor:", " m_text:")); f.m_text = s.GetStringAfter(" m_text:"); return(f); } catch (Exception e) { Debug.LogError("[ProceduralObjects] Error : " + e.GetType().ToString() + " while parsing a TextField : " + e.Message); return(new TextField(0)); } }
public static UIElement CreateColorPicker(object source, string path, bool useAlpha, object storedValue) { ColorPicker colorPicker = new ColorPicker(); colorPicker.ColorMode = ColorMode.ColorCanvas; colorPicker.UsingAlphaChannel = useAlpha; Binding binding = new Binding(); binding.Source = source; binding.Mode = BindingMode.TwoWay; binding.Converter = _scConverter; binding.Path = new PropertyPath(path); BindingOperations.SetBinding(colorPicker, ColorPicker.SelectedColorProperty, binding); if (storedValue == null) { colorPicker.SelectedColor = Color.FromScRgb(1.0f, 0.8f, 0.8f, 0.8f); } else { SerializableColor color = (SerializableColor)storedValue; colorPicker.SelectedColor = Color.FromScRgb(color.scA, color.scR, color.scG, color.scB); } return(colorPicker); }
public Player(string name, int number, PlayerType playerType, SerializableColor serializableColor) { Name = name; Number = number; PlayerType = playerType; SerializableColor = serializableColor; }
public void ColorPicker(GUIContent prefix, Rect rect, ref SerializableColor c, bool displayColorPreview = true, bool previewOnIcon = false) { Color color = c; ColorPicker(prefix, rect, ref color, displayColorPreview, previewOnIcon); c = (SerializableColor)color; }
public BiomeFieldSwitchData(Sampler samp) { UpdateSampler(samp); name = "swampland"; min = 70; max = 90; color = (SerializableColor) new Color(0.196f, 0.804f, 0.196f, 1); }
public ColorVariable(string identity, string name, Color32 color, bool disableAlpha = true) { this.identity = identity; this.name = name; this.color = color; this.origColor = color; this.disableAlpha = disableAlpha; }
public void Initialize(Vector2 pos) { orderGroupRect = new Rect(); orderGroupRect.position = pos; orderGroupRect.size = new Vector2(240, 120); name = "ordering group"; color = (SerializableColor)Color.white; }
private static Color GetColor(SerializableColor backgroundColor) { if (backgroundColor == null) { return(new Color()); } return(Color.FromArgb(backgroundColor.R, backgroundColor.G, backgroundColor.B)); }
private void CreateFavoriteColor(SerializableColor serializableColor) { GameObject gameObject = Instantiate(_prefabs.wUIColorMenuFavorite.gameObject, _components.favoritesContainer, false); WUIColorMenuFavorite wUIColorMenuFavorite = gameObject.GetComponent <WUIColorMenuFavorite>(); gameObject.transform.SetAsLastSibling(); wUIColorMenuFavorite.Populate(serializableColor); }
public ColorVariable(ColorVariable option) { identity = option.identity; name = option.name; color = option.color; origColor = option.origColor; disableAlpha = option.disableAlpha; }
public PWOrderingGroup(Vector2 pos) { orderGroupRect = new Rect(); orderGroupRect.position = pos; orderGroupRect.size = new Vector2(240, 120); name = "ordering group"; color = (SerializableColor)Color.white; PWGUI = new PWGUIManager(); }
public bool ongoing = false; //defaults to false upon parsed, will be set to true if indicated by questStatus public Quest(int INDEX, string TYPE, string DESCRIPTION, string MSG, string SPECIFICS, string LONG_MSG, Color MSG_COLOR, Vector2 LOCATION) //need not be serializable in params b/c of implicit operator casting { index = INDEX; type = TYPE; description = DESCRIPTION; message = MSG; specifics = SPECIFICS; long_message = LONG_MSG; message_color = MSG_COLOR; location = LOCATION; }
public static bool IsDifference(TextField A, TextField B) { if (A.x != B.x) { return(true); } if (A.y != B.y) { return(true); } if (A.m_text != B.m_text) { return(true); } if (A.m_fontSize != B.m_fontSize) { return(true); } if (SerializableColor.Different(A.m_fontColor, B.m_fontColor)) { return(true); } if (A.m_spacing != B.m_spacing) { return(true); } if (A.m_style != B.m_style) { return(true); } if (A.m_font != B.m_font) { return(true); } if (A.m_rotation != B.m_rotation) { return(true); } if (A.m_scaleX != B.m_scaleX) { return(true); } if (A.m_scaleY != B.m_scaleY) { return(true); } if (A.m_height != B.m_height) { return(true); } if (A.m_width != B.m_width) { return(true); } return(false); }
public void UE_AddFavorite() { if (GameHead.instance.universeData.savedColors == null) { GameHead.instance.universeData.savedColors = new List <SerializableColor>(); } SerializableColor serializableColor = new SerializableColor(_data.activeColor); GameHead.instance.universeData.savedColors.Add(serializableColor); CreateFavoriteColor(serializableColor); }
public PWAnchorMultiData(Color color) { //dont touych to id, it is generated by the window additional = false; enabled = true; linkCount = 0; highlighMode = PWAnchorHighlight.None; visibility = PWVisibility.Visible; this.color = (SerializableColor)color; forcedY = -1; }
public BiomeSwitchData(Sampler samp, string samplerName) { UpdateSampler(samp); name = "swampland"; min = 70; max = 90; this.samplerName = samplerName; var rand = new System.Random(); color = (SerializableColor) new Color((float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble()); }
// Can't save textures easily public EDSettings(BladeEdgeDetection edgeDetection) { this.edgeColorMode = edgeDetection.edgeColorMode; this.edgeColor = edgeDetection.edgeColor; this.edgeColorGradient = new Gradient { alphaKeys = edgeDetection.edgeColorGradient.alphaKeys, colorKeys = edgeDetection.edgeColorGradient.colorKeys, mode = edgeDetection.edgeColorGradient.mode }; }
public Kaiju(Color color, int handType, int headType, int bodyType, string name) { _color = new SerializableColor(); MonsterColor = color; _handType = handType; _headType = headType; _bodyType = bodyType; _name = name; _givenName = ""; _helpers = null; // not an empty list. the list will be created once the egg hatches. }
internal SerializableGradient(SerializableGradient serializableGradient) { if (serializableGradient == null) { left = new SerializableColor(Color.white); right = new SerializableColor(Color.black); return; } left = new SerializableColor(serializableGradient.left.color); right = new SerializableColor(serializableGradient.right.color); }
public void UseColorInLayoutCommand_IsExecutedWithSerializableColor_ShouldSetSelectedColor() { // Arrange var viewModel = GetViewModel(); var expectedColor = new SerializableColor(Colors.LimeGreen); // Act viewModel.UseColorInLayoutCommand.Execute(expectedColor); // Assert Assert.Equal(expectedColor, viewModel.SelectedColor); }
public Team(string name, int defence = 1, int midfield = 1, int attack = 1, Color bgColor = default(Color), Color textColor = default(Color)) { this.pointsInLeague = 0; this.name = name; this.defence = defence; this.midfield = midfield; this.attack = attack; this.defenceYellowCards = 0; this.midfieldYellowCards = 0; this.attackYellowCards = 0; this.bgColor = bgColor; this.textColor = textColor; }
private void LoadColorPicker(SerializableColor color) { GameObject itemDisplay = Instantiate(ColorItemPrefab); itemDisplay.transform.SetParent(ColorPageContainer.transform, false); itemDisplay.GetComponentInChildren <Image>().color = color.ToColor(); var itemButton = itemDisplay.AddComponent <ColorItemButton>(); itemButton.OnButtonClick = OnButtonClick; itemButton.BtnName = "ColorItem"; itemButton.Color = color.ToColor(); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { SerializableColor color = value as SerializableColor; if (color != null) { return(Color.FromScRgb(color.scA, color.scR, color.scG, color.scB)); } else { return(null); } }
public ModuleArtDecalData(ModuleArtDecalData cosmeticDecalData) { id = cosmeticDecalData.id; parentId = cosmeticDecalData.parentId; name = cosmeticDecalData.name; position = cosmeticDecalData.position; rotation = cosmeticDecalData.rotation; scale = cosmeticDecalData.scale; tags = cosmeticDecalData.tags; color = new SerializableColor(cosmeticDecalData.color.color); decalTextureIndex = cosmeticDecalData.decalTextureIndex; }
public PortalSave(Portal portal) : base(portal) { this.channel = portal.channel; this.changeActiveSceneOnTeleport = portal.changeActiveSceneOnTeleport; this.changeCameraEdgeDetection = portal.changeCameraEdgeDetection; this.edgeColorMode = (int)portal.edgeColorMode; this.edgeColor = portal.edgeColor; this.edgeColorGradient = portal.edgeColorGradient; this.renderRecursivePortals = portal.renderRecursivePortals; this.compositePortal = portal.compositePortal; this.teleportingPlayer = portal.teleportingPlayer; this.pauseRenderingOnly = portal.pauseRenderingOnly; this.pauseRenderingAndLogic = portal.pauseRenderingAndLogic; }