/// <summary> /// /// </summary> /// <param name="this"></param> /// <param name="opacity"></param> /// <returns></returns> public static MaterialBrush WithOpacity( this MaterialBrush @this, double opacity) { @this.IsNotNull(nameof(@this)); if (opacity.IsNotWithin((0d, 1d))) { throw new ArgumentOutOfRangeException( nameof(opacity), opacity, "The opacity parameter must be between 0 and 1, inclusively."); } var color = @this .Brush .Color .WithOpacity( opacity); var identity = new MaterialIdentity( @this.Identity.SwatchClassifier, @this.Identity.Luminosity, opacity); return(new MaterialBrush(color.ToSCB(), identity)); //return MaterialBrush.Create( // color, // identity); }
private void Awake() { heightBrush = new HeightBrush(HexEditMesh); materialBrush = new MaterialBrush(HexEditMesh); sceneObjBrush = new SceneObjBrush(HexEditMesh); edgeBrush = new EdgeBrush(HexEditMesh); waterBrush = new WaterBrush(HexEditMesh); Init(); EditorSceneManager.sceneOpening -= CloseScene; EditorSceneManager.sceneOpening += CloseScene; }