c# - Mod_Color.cs(55,55): Error CS0241: Default parameter specifiers are not permitted (CS0241) (Assembly-CSharp) -


i error while trying compile in c# (in monodevelop unity) please tell me how can fix it

mod_color.cs(55,55): error cs0241: default parameter specifiers not permitted (cs0241) (assembly-csharp) 

code:

namespace testhack.render {     using system;     using system.runtime.interopservices;     using unityengine;      public class mod_color     {         private color color;          public mod_color(float r, float g, float b, float = 255f)         {             this.color = new color(r / 255f, g / 255f, b / 255f, / 255f);         }          public color get()         {             return this.color;         }     } } 

use 2 overloads:

public class mod_color {     private color color;      public mod_color(float r, float g, float b)     {         this.color = mod_color(r, g, b, 255f);     }      public mod_color(float r, float g, float b, float a)     {         this.color = new color(r / 255f, g / 255f, b / 255f, / 255f);     }      public color get()     {         return this.color;     } } 

it seems using .net framework or mono framework doesn't support default parameter specifiers. using overload works same way without having modify existing code.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

android - Pass an Serializable object in AIDL -