internal ColorScope(RichLogger logger, UnityEngine.Color color) : base(logger) { _oldColor = LoggerRef.Color; LoggerRef.SetColor(color); }
public override void DrawCone(float radius, float height, int upAxis, ref Matrix trans, ref Vector3 color) { UnityEngine.Vector3 pos = BSExtensionMethods2.ExtractTranslationFromMatrix(ref trans); UnityEngine.Quaternion rot = BSExtensionMethods2.ExtractRotationFromMatrix(ref trans); UnityEngine.Vector3 scale = BSExtensionMethods2.ExtractScaleFromMatrix(ref trans); UnityEngine.Color c = new UnityEngine.Color(color.X, color.Y, color.Z); BUtility.DebugDrawCone(pos, rot, scale, radius, height, upAxis, c); }
public override void DrawBox(ref Vector3 bbMin, ref Vector3 bbMax, ref Matrix trans, ref Vector3 color) { UnityEngine.Vector3 pos = BSExtensionMethods2.ExtractTranslationFromMatrix(ref trans); UnityEngine.Quaternion rot = BSExtensionMethods2.ExtractRotationFromMatrix(ref trans); UnityEngine.Vector3 scale = BSExtensionMethods2.ExtractScaleFromMatrix(ref trans); UnityEngine.Vector3 size = (bbMax - bbMin).ToUnity(); UnityEngine.Color c = new UnityEngine.Color(color.X, color.Y, color.Z); BUtility.DebugDrawBox(pos, rot, scale, size,c); }
public PlotData(string name, double[] xAxisData, double[] yAxisData, UnityEngine.Color lineColor) { this.name = name; this.xAxisData = new double[xAxisData.Length]; xAxisData.CopyTo(this.xAxisData, 0); this.yAxisData = new double[yAxisData.Length]; yAxisData.CopyTo(this.yAxisData, 0); this.lineColor = lineColor; }
public TextMeshRenderer(LWF lwf, UnityRenderer.TextContext context) : base(lwf, context) { m_matrix = new Matrix(0, 0, 0, 0, 0, 0); m_matrixForRender = new Matrix4x4(); m_colorMult = new UnityEngine.Color(); m_colorAdd = new UnityEngine.Color(); m_color = new Color32(); m_z = -1; }
public TextMeshRenderer(LWF lwf, TextContext context) : base(lwf, context) { m_mesh = new Mesh(); m_matrix = new Matrix4x4(); m_renderMatrix = new Matrix4x4(); m_colorMult = new UnityEngine.Color(); m_colorAdd = new UnityEngine.Color(); m_color = new Color32(); }
public void Init(Factory factory) { renderers = new List<IMeshRenderer>(); canvasRenderer = gameObject.AddComponent<UnityEngine.CanvasRenderer>(); UpdateSortingLayerAndOrder(factory); UpdateLayer(factory); if (factory.useAdditionalColor) { additionalColor = UnityEngine.Color.clear; property = new MaterialPropertyBlock(); additionalColorId = Shader.PropertyToID("_AdditionalColor"); } buffer = new UIVertexBuffer(); }
public void Init(Factory factory) { useLegacyMeshGeneration = false; renderers = new List<IMeshRenderer>(); UpdateSortingLayerAndOrder(factory); UpdateLayer(factory); if (factory.useAdditionalColor) { additionalColor = UnityEngine.Color.clear; property = new MaterialPropertyBlock(); additionalColorId = Shader.PropertyToID("_AdditionalColor"); } buffer = new UIVertexBuffer(); }
static int _m_GammaToLinearSpace(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.Color __cl_gen_to_be_invoked; translator.Get(L, 1, out __cl_gen_to_be_invoked); try { { UnityEngine.Color __cl_gen_ret = __cl_gen_to_be_invoked.GammaToLinearSpace( ); translator.PushUnityEngineColor(L, __cl_gen_ret); translator.UpdateUnityEngineColor(L, 1, __cl_gen_to_be_invoked); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
static StackObject *get_Item_4(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @index = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); UnityEngine.Color instance_of_this_method = (UnityEngine.Color) typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); var result_of_this_method = instance_of_this_method[index]; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method); __intp.Free(ptr_of_this_method); __ret->ObjectType = ObjectTypes.Float; *(float *)&__ret->Value = result_of_this_method; return(__ret + 1); }
static StackObject *Ctor_1(ILIntepreter __intp, StackObject *__esp, List <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Single b = *(float *)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Single g = *(float *)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Single r = *(float *)&ptr_of_this_method->Value; var result_of_this_method = new UnityEngine.Color(r, g, b); if (!isNewObj) { __ret--; WriteBackInstance(__domain, __ret, __mStack, ref result_of_this_method); return(__ret); } return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
public TextInfo(DescriptorStructure text) { this.text = text["Txt"].ToString(); //颜色路径EngineData/EngineDict/StyleRun/RunArray/StyleSheet/StyleSheetData/FillColor //UnityEngine.Debug.Log(Newtonsoft.Json.JsonConvert.SerializeObject(text)); var engineData = text["EngineData"] as StructureEngineData; var engineDict = engineData["EngineDict"] as Properties; var stylerun = engineDict["StyleRun"] as Properties; var runarray = stylerun["RunArray"] as ArrayList; var styleSheet = (runarray[0] as Properties)["StyleSheet"] as Properties; var styleSheetsData = (styleSheet as Properties)["StyleSheetData"] as Properties; fontSize = (int)(System.Single)styleSheetsData["FontSize"]; if (styleSheetsData.Contains("Font")) { fontName = styleSheetsData["Font"] as string; } var strokeColorProp = styleSheetsData["FillColor"] as Properties; var strokeColor = strokeColorProp["Values"] as ArrayList; color = new UnityEngine.Color(float.Parse(strokeColor[1].ToString()), float.Parse(strokeColor[2].ToString()), float.Parse(strokeColor[3].ToString()), float.Parse(strokeColor[0].ToString())); }
static int _m_GetProceduralColor(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.ProceduralMaterial __cl_gen_to_be_invoked = (UnityEngine.ProceduralMaterial)translator.FastGetCSObj(L, 1); try { { string inputName = LuaAPI.lua_tostring(L, 2); UnityEngine.Color __cl_gen_ret = __cl_gen_to_be_invoked.GetProceduralColor(inputName); translator.PushUnityEngineColor(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
static int _m_LerpUnclamped_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { UnityEngine.Color _a; translator.Get(L, 1, out _a); UnityEngine.Color _b; translator.Get(L, 2, out _b); float _t = (float)LuaAPI.lua_tonumber(L, 3); UnityEngine.Color gen_ret = UnityEngine.Color.LerpUnclamped(_a, _b, _t); translator.PushUnityEngineColor(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
public void DrawCircle(FVector2 center, float radius, Color color) { //if (!_primitiveBatch.IsReady()) //{ // throw new InvalidOperationException("BeginCustomDraw must be called before drawing anything."); //} const double increment = Math.PI * 2.0 / CircleSegments; double theta = 0.0; for (int i = 0; i < CircleSegments; i++) { FVector2 v1 = center + radius * new FVector2((float)Math.Cos(theta), (float)Math.Sin(theta)); FVector2 v2 = center + radius * new FVector2((float)Math.Cos(theta + increment), (float)Math.Sin(theta + increment)); lineListBatch.Add(FDVertex.FromLine(v1, v2, color)); //_primitiveBatch.AddVertex(v1, color, PrimitiveType.LineList); //_primitiveBatch.AddVertex(v2, color, PrimitiveType.LineList); theta += increment; } }
static StackObject *DrawRay_6(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.Color @color = (UnityEngine.Color) typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); UnityEngine.Vector3 @dir = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); UnityEngine.Vector3 @start = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); UnityEngine.Debug.DrawRay(@start, @dir, @color); return(__ret); }
static int _m_LerpUnclamped_xlua_st_(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); try { { UnityEngine.Color a; translator.Get(L, 1, out a); UnityEngine.Color b; translator.Get(L, 2, out b); float t = (float)LuaAPI.lua_tonumber(L, 3); UnityEngine.Color __cl_gen_ret = UnityEngine.Color.LerpUnclamped(a, b, t); translator.PushUnityEngineColor(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
int __CreateInstanceUnityEngineColor(RealStatePtr L, int gen_param_count) { ObjectTranslator translator = this; if (gen_param_count == 5 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5)) { float _r = (float)LuaAPI.lua_tonumber(L, 2); float _g = (float)LuaAPI.lua_tonumber(L, 3); float _b = (float)LuaAPI.lua_tonumber(L, 4); float _a = (float)LuaAPI.lua_tonumber(L, 5); UnityEngine.Color gen_ret = new UnityEngine.Color(_r, _g, _b, _a); translator.PushUnityEngineColor(L, gen_ret); return(1); } if (gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) { float _r = (float)LuaAPI.lua_tonumber(L, 2); float _g = (float)LuaAPI.lua_tonumber(L, 3); float _b = (float)LuaAPI.lua_tonumber(L, 4); UnityEngine.Color gen_ret = new UnityEngine.Color(_r, _g, _b); translator.PushUnityEngineColor(L, gen_ret); return(1); } if (gen_param_count == 1) { translator.PushUnityEngineColor(L, default(UnityEngine.Color)); return(1); } return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Color constructor!")); }
public GLTFMaterial(GLTFMaterial material, GLTFRoot gltfRoot) : base(material, gltfRoot) { if (material == null) { return; } if (material.PbrMetallicRoughness != null) { PbrMetallicRoughness = new PbrMetallicRoughness(material.PbrMetallicRoughness, gltfRoot); } if (material.CommonConstant != null) { CommonConstant = new MaterialCommonConstant(material.CommonConstant, gltfRoot); } if (material.NormalTexture != null) { NormalTexture = new NormalTextureInfo(material.NormalTexture, gltfRoot); } if (material.OcclusionTexture != null) { OcclusionTexture = new OcclusionTextureInfo(material.OcclusionTexture, gltfRoot); } if (material.EmissiveTexture != null) { EmissiveTexture = new TextureInfo(material.EmissiveTexture, gltfRoot); } EmissiveFactor = material.EmissiveFactor; AlphaMode = material.AlphaMode; AlphaCutoff = material.AlphaCutoff; DoubleSided = material.DoubleSided; }
int UnityEngineColor_m_HSVToRGB_xlua_st_(RealStatePtr L, int gen_param_count) { ObjectTranslator translator = this; if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) { float _H = (float)LuaAPI.lua_tonumber(L, 1); float _S = (float)LuaAPI.lua_tonumber(L, 2); float _V = (float)LuaAPI.lua_tonumber(L, 3); UnityEngine.Color gen_ret = UnityEngine.Color.HSVToRGB(_H, _S, _V); translator.PushUnityEngineColor(L, gen_ret); return(1); } if (gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4)) { float _H = (float)LuaAPI.lua_tonumber(L, 1); float _S = (float)LuaAPI.lua_tonumber(L, 2); float _V = (float)LuaAPI.lua_tonumber(L, 3); bool _hdr = LuaAPI.lua_toboolean(L, 4); UnityEngine.Color gen_ret = UnityEngine.Color.HSVToRGB(_H, _S, _V, _hdr); translator.PushUnityEngineColor(L, gen_ret); return(1); } return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Color.HSVToRGB!")); }
static StackObject *CrossFadeColor_25(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 5); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Boolean useAlpha = ptr_of_this_method->Value == 1; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Boolean ignoreTimeScale = ptr_of_this_method->Value == 1; ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Single duration = *(float *)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 4); UnityEngine.Color targetColor = (UnityEngine.Color) typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 5); UnityEngine.UI.Graphic instance_of_this_method; instance_of_this_method = (UnityEngine.UI.Graphic) typeof(UnityEngine.UI.Graphic).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); instance_of_this_method.CrossFadeColor(targetColor, duration, ignoreTimeScale, useAlpha); return(__ret); }
/// <summary> /// Parses a colour string and returns a colour object. /// </summary> /// <param name="Colour">The string containing the colour information. /// <list type="table"> /// <listheader> /// <term>Format</term> /// <term>Description</term> /// <term>Example</term> /// </listheader> /// <item> /// <term>rgb</term> /// <term>Specifies a colour in rgb format</term> /// <term>rgb(255,0,0)</term> /// </item> /// <item> /// <term>rgba</term> /// <term>Specifies a colour in rgb format with an alpha component</term> /// <term>rgba(255,0,0,128)</term> /// </item> /// </list> /// </param> /// <returns>The colour object initialized to colour information specified in <paramref name="Colour"/>.</returns> /// <remarks>This method is used primarily in conjunction with XML-based layouts.</remarks> /// <example> /// Generate a colour object from a string containing a red colour: /// <code>UnityEngine.Color c = Colour.Parse("rgb(255,0,0)");</code> /// Generate a colour object from a string containing a red colour with half transparency: /// <code>UnityEngine.Color c = Colour.Parse("rgba(255,0,0,128)");</code> /// </example> public static UnityEngine.Color?Parse(string Colour) { UnityEngine.Color?rgba; if (Colour != null && Colour != "") { // Colour in the form of a filename or an rgb(a) component MatchCollection mc = Regex.Matches(Colour, @"rgb?a?\s*\(\s*(?<red>\d+)\s*,\s*(?<green>\d+)\s*,\s*(?<blue>\d+)\s*\s*,?\s*(?<alpha>\d+)?\)"); if (mc.Count != 1) { throw new Exception("Error parsing colour string, unknown pattern"); } // r, g and b components are compulsory, a is optional if (mc[0].Groups["red"].Value == "" || mc[0].Groups["green"].Value == "" || mc[0].Groups["blue"].Value == "") { throw new Exception("Error parsing colour string, r, g or b components empty"); } float r, g, b, a; r = uint.Parse(mc[0].Groups["red"].Value) / 255.0f; g = uint.Parse(mc[0].Groups["green"].Value) / 255.0f; b = uint.Parse(mc[0].Groups["blue"].Value) / 255.0f; a = mc[0].Groups["alpha"].Value == "" ? 1.0f : uint.Parse(mc[0].Groups["alpha"].Value) / 255.0f; rgba = new UnityEngine.Color(r, g, b, a); } else { rgba = null; } return(rgba); }
static int _m_Evaluate(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.Gradient gen_to_be_invoked = (UnityEngine.Gradient)translator.FastGetCSObj(L, 1); { float _time = (float)LuaAPI.lua_tonumber(L, 2); UnityEngine.Color gen_ret = gen_to_be_invoked.Evaluate(_time); translator.PushUnityEngineColor(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
public void OnDrawGizmosSelected() { if (!enabled) { return; } UnityEngine.Gizmos.DrawIcon(transform.position, "WwiseAudioSpeaker.png", false); #if UNITY_EDITOR if (multiPositionTypeLabel == MultiPositionTypeLabel.Large_Mode) { foreach (var entry in LargeModePositions) { if (entry != null) { UnityEngine.Gizmos.color = UnityEngine.Color.green; UnityEngine.Gizmos.DrawSphere(entry.transform.position, 0.1f); UnityEditor.Handles.Label(entry.transform.position, entry.name); AkRadialEmitter radialEmitter = GetComponent <AkRadialEmitter>(); if (radialEmitter) { UnityEngine.Color SphereColor = UnityEngine.Color.yellow; SphereColor.a = 0.25f; UnityEngine.Gizmos.color = SphereColor; UnityEngine.Gizmos.DrawSphere(entry.transform.position, radialEmitter.innerRadius); UnityEngine.Gizmos.DrawSphere(entry.transform.position, radialEmitter.outerRadius); } } } } #endif }
static StackObject *Clear_31(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 4); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Single @depth = *(float *)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); UnityEngine.Color @backgroundColor = (UnityEngine.Color) typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Boolean @clearColor = ptr_of_this_method->Value == 1; ptr_of_this_method = ILIntepreter.Minus(__esp, 4); System.Boolean @clearDepth = ptr_of_this_method->Value == 1; UnityEngine.GL.Clear(@clearDepth, @clearColor, @backgroundColor, @depth); return(__ret); }
static int _m_IntToColor_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { int _i = LuaAPI.xlua_tointeger(L, 1); float _a = (float)LuaAPI.lua_tonumber(L, 2); UnityEngine.Color gen_ret = Pathfinding.UnityHelper.IntToColor( _i, _a); translator.PushUnityEngineColor(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
static int _m_NodeColor(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Pathfinding.Util.GraphGizmoHelper gen_to_be_invoked = (Pathfinding.Util.GraphGizmoHelper)translator.FastGetCSObj(L, 1); { PF.GraphNode _node = (PF.GraphNode)translator.GetObject(L, 2, typeof(PF.GraphNode)); UnityEngine.Color gen_ret = gen_to_be_invoked.NodeColor(_node); translator.PushUnityEngineColor(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
static int _m_GetPixel(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.Texture2D __cl_gen_to_be_invoked = (UnityEngine.Texture2D)translator.FastGetCSObj(L, 1); try { { int x = LuaAPI.xlua_tointeger(L, 2); int y = LuaAPI.xlua_tointeger(L, 3); UnityEngine.Color __cl_gen_ret = __cl_gen_to_be_invoked.GetPixel(x, y); translator.PushUnityEngineColor(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
void Awake() { var harmony = new Harmony(PluginGuid); harmony.PatchAll(Assembly.GetExecutingAssembly()); Enabled = Config.Bind("Settings", "Enabled", true, new ConfigDescription("Turn this off to stop the water change", null, new ConfigurationManagerAttributes { Order = 5 })); WaterR = Config.Bind("Settings", "Water R", 1f, new ConfigDescription("Red value for the water", null, new ConfigurationManagerAttributes { Order = 4 })); WaterR.SettingChanged += UpdateWaterColor; WaterG = Config.Bind("Settings", "Water G", 1f, new ConfigDescription("Green value for the water", null, new ConfigurationManagerAttributes { Order = 3 })); WaterG.SettingChanged += UpdateWaterColor; WaterB = Config.Bind("Settings", "Water B", 1f, new ConfigDescription("Blue value for the water", null, new ConfigurationManagerAttributes { Order = 2 })); WaterB.SettingChanged += UpdateWaterColor; WaterA = Config.Bind("Settings", "Water A", 1f, new ConfigDescription("Alpha value for the water", null, new ConfigurationManagerAttributes { Order = 1 })); WaterA.SettingChanged += UpdateWaterColor; this.isEnabled = true; this.isCheat = false; PolyTechFramework.PolyTechMain.registerMod(this); waterColor = new Color(WaterR.Value, WaterG.Value, WaterB.Value, WaterA.Value); }
public static LinearColor Convert(UnityEngine.Color color, float intensity) { var lc = GraphicsSettings.lightsUseLinearIntensity ? color.linear.RGBMultiplied(intensity) : color.RGBMultiplied(intensity).linear; float mcc = lc.maxColorComponent; if (lc.r < 0.0f || lc.g < 0.0f || lc.b < 0.0f) { throw new System.ArgumentOutOfRangeException("The input color to be converted must not contain negative values (red: " + lc.r + ", green: " + lc.g + ", blue: " + lc.b + ")."); } if (mcc <= 1e-20f) { return(LinearColor.Black()); } float mcc_rcp = 1.0f / lc.maxColorComponent; LinearColor c; c.m_red = lc.r * mcc_rcp; c.m_green = lc.g * mcc_rcp; c.m_blue = lc.b * mcc_rcp; c.m_intensity = mcc; return(c); }
static StackObject *DrawEllipse_9(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 4); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); UnityEngine.Color @fillColor = (UnityEngine.Color) typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Single @aHeight = *(float *)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Single @aWidth = *(float *)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 4); FairyGUI.GGraph instance_of_this_method = (FairyGUI.GGraph) typeof(FairyGUI.GGraph).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); instance_of_this_method.DrawEllipse(@aWidth, @aHeight, @fillColor); return(__ret); }
public static string ConvertToHexString(UnityEngine.Color color) { int r = (int)(color.r * 255.0); int g = (int)(color.g * 255.0); int b = (int)(color.b * 255.0); int a = (int)(color.a * 255.0); if (color.a == 1.0f) { StringBuilder builder = new StringBuilder(7); return(builder .Append(DecimalToHex[r >> 4]) .Append(DecimalToHex[r & 15]) .Append(DecimalToHex[g >> 4]) .Append(DecimalToHex[g & 15]) .Append(DecimalToHex[b >> 4]) .Append(DecimalToHex[b & 15]) .ToString()); } else { StringBuilder builder = new StringBuilder(9); return(builder .Append(DecimalToHex[r >> 4]) .Append(DecimalToHex[r & 15]) .Append(DecimalToHex[g >> 4]) .Append(DecimalToHex[g & 15]) .Append(DecimalToHex[b >> 4]) .Append(DecimalToHex[b & 15]) .Append(DecimalToHex[a >> 4]) .Append(DecimalToHex[a & 15]) .ToString()); } }
static StackObject *DrawRay_8(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 5); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Boolean depthTest = ptr_of_this_method->Value == 1; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Single duration = *(float *)&ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 3); UnityEngine.Color color = (UnityEngine.Color) typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); UnityEngine.Vector3 dir = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 5); UnityEngine.Vector3 start = (UnityEngine.Vector3) typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); UnityEngine.Debug.DrawRay(start, dir, color, duration, depthTest); return(__ret); }
static int _m_GetPixelBilinear(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UnityEngine.Texture2D __cl_gen_to_be_invoked = (UnityEngine.Texture2D)translator.FastGetCSObj(L, 1); try { { float u = (float)LuaAPI.lua_tonumber(L, 2); float v = (float)LuaAPI.lua_tonumber(L, 3); UnityEngine.Color __cl_gen_ret = __cl_gen_to_be_invoked.GetPixelBilinear(u, v); translator.PushUnityEngineColor(L, __cl_gen_ret); return(1); } } catch (System.Exception __gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e)); } }
/// <summary> /// Add button that can execute function. /// </summary> /// <param name="mod">Your mod instance</param> /// <param name="setting">Your settings variable</param> /// <param name="normalColor">Button color</param> /// <param name="highlightedColor">Button color when highlighted</param> /// <param name="pressedColor">Button color when pressed</param> /// <param name="buttonTextColor">Text color on Button</param> /// <param name="description">Short optional description for this button</param> /// <example><code source="SettingsExamples.cs" region="AddButton" lang="C#" /// title="Add button" /></example> public static void AddButton(Mod mod, Settings setting, UnityEngine.Color normalColor, UnityEngine.Color highlightedColor, UnityEngine.Color pressedColor, UnityEngine.Color buttonTextColor, string description = null) { setting.Mod = mod; setting.Vals = new object[5]; if (description == null) { description = string.Empty; } if (setting.DoAction != null) { setting.type = SettingsType.Button; setting.Vals[0] = description; setting.Vals[1] = normalColor; setting.Vals[2] = highlightedColor; setting.Vals[3] = pressedColor; setting.Vals[4] = buttonTextColor; modSettings.Add(setting); } else { ModConsole.Error("AddButton: Action cannot be null."); } }
public BitmapRenderer(LWF lwf, BitmapContext context) : base(lwf) { m_context = context; m_matrix = new Matrix4x4(); m_colorMult = new UnityEngine.Color(); #if LWF_USE_ADDITIONALCOLOR m_colorAdd = new UnityEngine.Color(); #endif m_available = false; if (m_context != null) m_context.factory.AddBitmap(); }
public Action_bt_Level_DeathMatch_0_node37() { this.m_resultOption = EBTStatus.BT_SUCCESS; method_p0 = "Tank_Nav"; method_p1 = new UnityEngine.Color(); method_p1.a = 1f; method_p1.b = 0f; method_p1.g = 0f; method_p1.r = 1f; }
/// <summary> /// Draw a solid closed polygon provided in CCW order. /// </summary> /// <param name="vertices">The vertices.</param> /// <param name="count">The vertex count.</param> /// <param name="red">The red value.</param> /// <param name="blue">The blue value.</param> /// <param name="green">The green value.</param> public abstract void DrawSolidPolygon(Vector2[] vertices, int count, Color color);
public void Init(Factory factory) { renderers = new List<IMeshRenderer>(); mesh = new Mesh(); mesh.name = "LWF/" + factory.data.name; mesh.MarkDynamic(); meshFilter = gameObject.AddComponent<MeshFilter>(); meshFilter.sharedMesh = mesh; meshRenderer = gameObject.AddComponent<UnityEngine.MeshRenderer>(); #if UNITY_4_6 meshRenderer.castShadows = false; #else meshRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; #endif meshRenderer.receiveShadows = false; UpdateSortingLayerAndOrder(factory); UpdateLayer(factory); if (factory.useAdditionalColor) { additionalColor = UnityEngine.Color.clear; property = new MaterialPropertyBlock(); additionalColorId = Shader.PropertyToID("_AdditionalColor"); } buffer = new CombinedMeshBuffer(); }
public Action_bt_Level_Survival_node22() { this.m_resultOption = EBTStatus.BT_SUCCESS; method_p0 = "Tank_Agressive"; method_p1 = new UnityEngine.Color(); method_p1.a = 1f; method_p1.b = 0f; method_p1.g = 1f; method_p1.r = 0f; }
public void SetMaterial(Material mat, UnityEngine.Color ac) { gameObject.SetActive(true); material = mat; additionalColor = ac; buffer.modified = true; SetMaterialDirty(); }
public TextRenderer(LWF lwf, TextContext context) : base(lwf) { m_context = context; m_matrix = new Matrix4x4(); m_renderMatrix = new Matrix4x4(); m_colorMult = new UnityEngine.Color(); #if LWF_USE_ADDITIONALCOLOR m_colorAdd = new UnityEngine.Color(); #endif if (m_context != null && m_context.systemFontRenderer != null) { ISystemFontRenderer.Parameter p = context.systemFontRendererParameter; float scale = lwf.scaleByStage; m_context.systemFontRenderer.Init( p.mSize * scale, p.mWidth * scale, p.mHeight * scale, p.mStyle, p.mAlign, p.mVerticalAlign, p.mLineSpacing * scale, p.mLetterSpacing * scale, p.mLeftMargin * scale, p.mRightMargin * scale); } }
public BitmapRenderer(LWF lwf, BitmapContext context) : base(lwf) { m_context = context; m_property = new MaterialPropertyBlock(); m_matrix = new Matrix4x4(); m_renderMatrix = new Matrix4x4(); m_colorMult = new UnityEngine.Color(); m_colorAdd = new UnityEngine.Color(); m_blendMode = (int)Format.Constant.BLEND_MODE_NORMAL; m_colorId = Shader.PropertyToID("_Color"); m_additionalColorId = Shader.PropertyToID("_AdditionalColor"); }
public BitmapRenderer(LWF lwf, BitmapContext context) : base(lwf) { m_context = context; m_matrix = new Matrix(0, 0, 0, 0, 0, 0); m_matrixForRender = new Matrix4x4(); m_colorMult = new UnityEngine.Color(); m_colorAdd = new UnityEngine.Color(); m_z = -1; m_updated = false; }
/// <summary> /// Draw a circle. /// </summary> /// <param name="center">The center.</param> /// <param name="radius">The radius.</param> /// <param name="red">The red value.</param> /// <param name="blue">The blue value.</param> /// <param name="green">The green value.</param> public abstract void DrawCircle(Vector2 center, float radius, Color color);
public CmdMaterialSetColor(Guid _materialGuid, string _name, UnityEngine.Color _color) { materialGuid = _materialGuid; name = _name; color = _color; }
private void FeelingMonitorPanel(int id) { Dictionary<string, float> feelingValueMap = _connector.FeelingValueMap; if(feelingValueMap.Count == 0) { return; } _scrollPosition = UnityEngine.GUILayout.BeginScrollView(_scrollPosition); float feelingBarWidth = UnityEngine.Screen.width * 0.3f; _boxStyle = _panelSkin.box; lock(feelingValueMap) { int topOffset = 5; foreach(string feeling in feelingValueMap.Keys) { if(!_isFeelingTextureMapInitialized) { float r = UnityEngine.Random.value; float g = UnityEngine.Random.value; float b = UnityEngine.Random.value; UnityEngine.Color c = new UnityEngine.Color(r, g, b, 0.6f); UnityEngine.Texture2D t = new UnityEngine.Texture2D(1, 1); t.SetPixel(0, 0, c); t.Apply(); _feelingTextureMap[feeling] = t; } float value = feelingValueMap[feeling]; // Set the texture of background. _boxStyle.normal.background = _feelingTextureMap[feeling]; UnityEngine.GUILayout.BeginHorizontal(); UnityEngine.GUILayout.Label(feeling + ": ", _panelSkin.label, UnityEngine.GUILayout.MaxWidth(_panel.width * 0.3f)); UnityEngine.GUILayout.Box("", _boxStyle, UnityEngine.GUILayout.Width(feelingBarWidth * value), UnityEngine.GUILayout.Height(16)); UnityEngine.GUILayout.EndHorizontal(); topOffset += 15; } // We only need to initialize the map at the first time. if(!_isFeelingTextureMapInitialized) { _isFeelingTextureMapInitialized = true; } } UnityEngine.GUILayout.EndScrollView(); }
/// <summary> /// Draw a line segment. /// </summary> /// <param name="start">The start.</param> /// <param name="end">The end.</param> /// <param name="red">The red value.</param> /// <param name="blue">The blue value.</param> /// <param name="green">The green value.</param> public abstract void DrawSegment(Vector2 start, Vector2 end, Color color);
public void SetMaterial(Material material, UnityEngine.Color ac) { if (meshRenderer.sharedMaterial != material) meshRenderer.sharedMaterial = material; additionalColor = ac; buffer.modified = true; }
/// <summary> /// Draw a solid circle. /// </summary> /// <param name="center">The center.</param> /// <param name="radius">The radius.</param> /// <param name="axis">The axis.</param> /// <param name="red">The red value.</param> /// <param name="blue">The blue value.</param> /// <param name="green">The green value.</param> public abstract void DrawSolidCircle(Vector2 center, float radius, Vector2 axis, Color color);
public BitmapRenderer(LWF lwf, BitmapContext context) : base(lwf) { m_context = context; m_property = new MaterialPropertyBlock(); m_matrix = new Matrix4x4(); m_renderMatrix = new Matrix4x4(); m_colorMult = new UnityEngine.Color(); #if LWF_USE_ADDITIONALCOLOR m_colorAdd = new UnityEngine.Color(); #endif }
public TextRenderer(LWF lwf, TextContext context) : base(lwf) { m_context = context; m_matrix = new Matrix4x4(); m_renderMatrix = new Matrix4x4(); m_colorMult = new UnityEngine.Color(); #if LWF_USE_ADDITIONALCOLOR m_colorAdd = new UnityEngine.Color(); #endif if (m_context != null && m_context.systemFontRenderer != null) { ISystemFontRenderer.Parameter p = context.systemFontRendererParameter; float scale = lwf.scaleByStage; m_context.systemFontRenderer.Init( p.mSize * scale, p.mWidth * scale, p.mHeight * scale, p.mStyle, p.mAlign, p.mVerticalAlign, p.mLineSpacing * scale, p.mLetterSpacing * scale, p.mLeftMargin * scale, p.mRightMargin * scale); } CombinedMeshRenderer.Factory factory = lwf.rendererFactory as CombinedMeshRenderer.Factory; if (factory != null) { m_shouldBeOnTop = true; m_zOffset = Mathf.Abs(factory.zRate); } }
public override void DrawPlane(ref Vector3 planeNormal, float planeConst, ref Matrix trans, ref Vector3 color) { UnityEngine.Vector3 pos = BSExtensionMethods2.ExtractTranslationFromMatrix(ref trans); UnityEngine.Quaternion rot = BSExtensionMethods2.ExtractRotationFromMatrix(ref trans); UnityEngine.Vector3 scale = BSExtensionMethods2.ExtractScaleFromMatrix(ref trans); UnityEngine.Color c = new UnityEngine.Color(color.X, color.Y, color.Z); BUtility.DebugDrawPlane(pos, rot, scale, planeNormal.ToUnity(), planeConst, c); }
public override void DrawSphere(ref Vector3 p, float radius, ref Vector3 color) { UnityEngine.Color c = new UnityEngine.Color(color.X, color.Y, color.Z); BUtility.DebugDrawSphere(p.ToUnity(),UnityEngine.Quaternion.identity,UnityEngine.Vector3.one, UnityEngine.Vector3.one * radius, c); }
public TextContext(Factory f, GameObject p, Data data, Format.Text text) { factory = f; parent = p; Format.TextProperty textProperty = data.textProperties[text.textPropertyId]; Format.Font fontProperty = data.fonts[textProperty.fontId]; color = factory.ConvertColor(data.colors[text.colorId]); string str = data.strings[text.stringId]; string fontName = data.strings[fontProperty.stringId]; string fontPath = factory.fontPrefix + fontName; float fontHeight = (float)textProperty.fontHeight; float width = (float)text.width; float height = (float)text.height; float lineSpacing = 1.0f + (float)textProperty.leading / fontHeight; float letterSpacing = (float)fontProperty.letterspacing / fontHeight; float tabSpacing = 4.0f; float leftMargin = textProperty.leftMargin / fontHeight; float rightMargin = textProperty.rightMargin / fontHeight; if (fontName.StartsWith("_")) { ISystemFontRenderer.Style style = ISystemFontRenderer.Style.NORMAL; ISystemFontRenderer.Align align; int a = textProperty.align & (int)Align.ALIGN_MASK; switch (a) { default: case (int)Align.LEFT: align = ISystemFontRenderer.Align.LEFT; break; case (int)Align.RIGHT: align = ISystemFontRenderer.Align.RIGHT; break; case (int)Align.CENTER: align = ISystemFontRenderer.Align.CENTER; break; } ISystemFontRenderer.VerticalAlign valign; int va = textProperty.align & (int)Align.VERTICAL_MASK; switch (va) { default: valign = ISystemFontRenderer.VerticalAlign.TOP; break; case (int)Align.VERTICAL_BOTTOM: valign = ISystemFontRenderer.VerticalAlign.BOTTOM; break; case (int)Align.VERTICAL_MIDDLE: valign = ISystemFontRenderer.VerticalAlign.MIDDLE; break; } systemFontRendererParameter = new ISystemFontRenderer.Parameter( fontHeight, width, height, style, align, valign, lineSpacing, letterSpacing, leftMargin, rightMargin); systemFontRenderer = ISystemFontRenderer.Construct(); systemFontRenderer.SetText(str, color); } else { BitmapFont.Renderer.Align align; int a = textProperty.align & (int)Align.ALIGN_MASK; switch (a) { default: case (int)Align.LEFT: align = BitmapFont.Renderer.Align.LEFT; break; case (int)Align.RIGHT: align = BitmapFont.Renderer.Align.RIGHT; break; case (int)Align.CENTER: align = BitmapFont.Renderer.Align.CENTER; break; } BitmapFont.Renderer.VerticalAlign valign; int va = textProperty.align & (int)Align.VERTICAL_MASK; switch (va) { default: valign = BitmapFont.Renderer.VerticalAlign.TOP; break; case (int)Align.VERTICAL_BOTTOM: valign = BitmapFont.Renderer.VerticalAlign.BOTTOM; break; case (int)Align.VERTICAL_MIDDLE: valign = BitmapFont.Renderer.VerticalAlign.MIDDLE; break; } bitmapFontRenderer = new BitmapFont.Renderer(fontPath, fontHeight, width, height, align, valign, 0.25f, lineSpacing, letterSpacing, tabSpacing, leftMargin, rightMargin); bitmapFontRenderer.SetText(str, color); } }
public override void DrawArc(ref Vector3 center, ref Vector3 normal, ref Vector3 axis, float radiusA, float radiusB, float minAngle, float maxAngle, ref Vector3 color, bool drawSect, float stepDegrees) { UnityEngine.Color col = new UnityEngine.Color(color.X, color.Y, color.Z); BUtility.DebugDrawArc(center.ToUnity(), normal.ToUnity(), axis.ToUnity(), radiusA, radiusB, minAngle, maxAngle, col, drawSect, stepDegrees); }
public static Engine.Math.Color ToEngineColor(this UnityEngine.Color color) { UnityEngine.Color32 c32 = color; return(new Engine.Math.Color(c32.r, c32.g, c32.b, c32.a)); }
public void SetMaterial(Material material, UnityEngine.Color ac) { if (canvasRenderer.GetMaterial() != material) canvasRenderer.SetMaterial(material, null); additionalColor = ac; buffer.modified = true; }
private void UnturnedPlayerEvents_OnPlayerChatted(Rocket.Unturned.Player.UnturnedPlayer player, ref UnityEngine.Color color, string message, SDG.Unturned.EChatMode chatMode, ref bool cancel) { var result = GetChannel(player.CSteamID); if (result != null && chatMode == 0 && player.HasPermission("channel." + result.Channel.ToLower()) && result.Channel.ToLower() != "global" && !message.StartsWith("/") && !message.StartsWith("@")) { cancel = true; foreach (var steamplayer in Provider.clients) { UnturnedPlayer stm = UnturnedPlayer.FromSteamPlayer(steamplayer); if (stm.HasPermission("channel." + result.Channel.ToLower())) { UnturnedChat.Say(steamplayer.playerID.steamID, "[" + result.Channel + "] " + player.CharacterName + " : " + message); Times = 1; } } } if (result.Channel.ToLower() == "global" && chatMode == 0 && (!message.StartsWith("/") && !message.StartsWith("@"))) { if (player.HasPermission("chat.global")) { ChatManager.instance.askChat(player.CSteamID, 0, message); Times = 1; } } if (Times == 0) { UnturnedChat.Say(player, Translate("no_permission")); } }
public Action_bt_Level_DeathMatch_0_node10() { this.m_resultOption = EBTStatus.BT_SUCCESS; method_p0 = "Tank_Wander_RandomFire"; method_p2 = new UnityEngine.Color(); method_p2.a = 1f; method_p2.b = 1f; method_p2.g = 0f; method_p2.r = 0f; }