bool CheckDistance() { if (Vector3.Distance(robotP1.transform.position, robotP2.transform.position) <= 5) { ColorLight mixedColor = ColorUtils.CombineColors(p1Controller.personalColor, p2Controller.personalColor); p1Controller.updateCurrentColor(mixedColor); p2Controller.updateCurrentColor(mixedColor); EnergyBattery.instance.SetOverheat(true); return(true); } else { p1Controller.updateCurrentColor(p1Controller.personalColor); p2Controller.updateCurrentColor(p2Controller.personalColor); EnergyBattery.instance.SetOverheat(false); if (mSource.isPlaying) { mSource.Stop(); } return(false); } }
public void updateLightColor(ColorLight colorLight) { Color color = ColorUtils.GetColor(colorLight); GetComponent <Renderer> ().material.color = color; currentLight = colorLight; }
public static Color GetColor(ColorLight colorLight) { switch (colorLight) { case ColorLight.Blue: return(GetColorFromHex("#579DD6")); case ColorLight.Green: return(GetColorFromHex("#97FFAB")); case ColorLight.Orange: return(GetColorFromHex("#FF994D")); case ColorLight.Purple: return(GetColorFromHex("#CC8BF7")); case ColorLight.Red: return(GetColorFromHex("#EA503D")); case ColorLight.Yellow: return(GetColorFromHex("#F4E572")); default: return(Color.black); } }
void ShowModuleScreen(Module m) { BaseWidget widget = null; // ModuleParameter widgetProperty = m.GetProperty("Widget.DisplayModule"); if (widgetProperty != null && !String.IsNullOrEmpty(widgetProperty.Value)) { switch (widgetProperty.Value) { case "homegenie/generic/light": case "homegenie/generic/switch": widget = new Switch(); break; case "homegenie/generic/dimmer": widget = new Dimmer(); break; case "homegenie/generic/colorlight": widget = new ColorLight(); break; case "weather/wunderground/conditions": widget = new Weather(); break; default: break; } } // if (widget == null) { if (m.DeviceType == "Dimmer" || m.DeviceType == "Light" || m.DeviceType == "Shutter" || m.DeviceType == "Siren") { widget = new Dimmer(); } else if (m.DeviceType == "Switch") { widget = new Switch(); } } // if (widget != null) { widget.CloseButtonClicked += (sender, args) => { this.Controls.Remove(widget); this.Controls.Add(currentWidget); widgetCycle.Start(); }; widget.Module = m; widget.Dock = DockStyle.Fill; // widgetCycle.Stop(); this.Controls.Remove(currentWidget); this.Controls.Add(widget); } }
// Use this for initialization void Start() { enabled = true; currentLight = ColorLight.Blue; GameManager.instance.activeChests++; GameManager.instance.UpdateText(); mAnimator = GetComponentInChildren <Animator> (); mAudio = GetComponent <AudioSource> (); }
// Use this for initialization void Start() { initialPosition = transform.position; currentState = State.Normal; updateCurrentColor(ColorLight.Blue); personalColor = ColorLight.Blue; mAnimator = GetComponentInChildren <Animator> (); }
public static bool isMixedColor(ColorLight color) { if (color == ColorLight.Yellow && color == ColorLight.Blue && color == ColorLight.Red) { return(true); } else { return(false); } }
public void updateCurrentColor(ColorLight colorLight) { Color color = ColorUtils.GetColor(colorLight); mLight.color = color; effect.startColor = color; effect.endColor = color; color.a = 0.6f; robotHead.GetComponent <Renderer> ().material.color = color; currentColor = colorLight; }
public static ColorLight CombineColors(ColorLight color1, ColorLight color2) { if (color1 == ColorLight.Blue) { switch (color2) { case ColorLight.Yellow: return(ColorLight.Green); case ColorLight.Red: return(ColorLight.Purple); } } else if (color1 == ColorLight.Yellow) { switch (color2) { case ColorLight.Blue: return(ColorLight.Green); case ColorLight.Red: return(ColorLight.Orange); case ColorLight.Yellow: return(ColorLight.Yellow); } } else if (color1 == ColorLight.Red) { switch (color2) { case ColorLight.Yellow: return(ColorLight.Orange); case ColorLight.Blue: return(ColorLight.Purple); case ColorLight.Red: return(ColorLight.Red); } } return(ColorLight.Blue); }
private void Awake() { _colorLight = GetComponentInChildren <ColorLight>(); _tweenerSimple = GetComponent <Tweener_Simple>(); }
/// <summary> /// Returns a new color with the given alpha. /// </summary> public Color ColorLightWithAlpha(float alpha) { return(ColorLight.WithAlpha(alpha)); }
/// <summary> /// Returns a new color with the RGB values scaled so that the color has the given brightness. /// <para>If the color is too dark, a grey is returned with the right brighness. The alpha is left uncanged.</para> /// </summary> public Color ColorLightWithBrightness(float brightness) { return(ColorLight.WithBrightness(brightness)); }
public void updatePersonalColor(ColorLight colorLight) { updateCurrentColor(colorLight); personalColor = colorLight; }