-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retarget to net 3.5 also added extra function to support this, nameof…
… as it is from net 4.x.
- Loading branch information
Showing
24 changed files
with
8,053 additions
and
13,587 deletions.
There are no files selected for viewing
21,288 changes: 7,902 additions & 13,386 deletions
21,288
Assets/Skinnable/Demos/Scenes/Skinned_0.unity
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
Assets/Skinnable/Demos/Styles/User toggle/Toggle/Someusertoggle.asset
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
Assets/Skinnable/Demos/Styles/User toggle/Toggle/Someusertoggle.asset.meta
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 41 additions & 18 deletions
59
Assets/Skinnable/Scripts/DefaultThemes/ColorBlockTheme.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,50 @@ | ||
using Skinnable; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class ColorBlockTheme : BaseStyle<ColorBlock> { | ||
namespace Skinnable { | ||
public class ColorBlockTheme : BaseStyle<ColorBlock> { | ||
|
||
public Color normalColor = Color.white; | ||
public Color highlightedColor = Color.white; | ||
public Color pressedColor = Color.white; | ||
public Color disabledColor = Color.white; | ||
public float colorMultiplier = 1.0f; | ||
public float fadeDuration = 0.1f; | ||
public Color normalColor = Color.white; | ||
public Color highlightedColor = Color.white; | ||
public Color pressedColor = Color.white; | ||
public Color disabledColor = Color.white; | ||
public float colorMultiplier = 1.0f; | ||
public float fadeDuration = 0.1f; | ||
|
||
public override void ApplyStyle(ref object targetObject) | ||
{ | ||
ColorBlock colorBlock = (ColorBlock) targetObject; | ||
public override void ApplyStyle(ref object targetObject) | ||
{ | ||
ColorBlock colorBlock = (ColorBlock) targetObject; | ||
|
||
if(ShouldApply(nameof(normalColor)) ) colorBlock.normalColor = normalColor; | ||
if(ShouldApply(nameof(highlightedColor)) ) colorBlock.highlightedColor = highlightedColor; | ||
if(ShouldApply(nameof(pressedColor)) ) colorBlock.pressedColor = pressedColor; | ||
if(ShouldApply(nameof(disabledColor)) ) colorBlock.disabledColor = disabledColor; | ||
if(ShouldApply(nameof(colorMultiplier)) ) colorBlock.colorMultiplier = colorMultiplier; | ||
if(ShouldApply(nameof(fadeDuration)) ) colorBlock.fadeDuration = fadeDuration; | ||
if(ShouldApply(this.nameof(b => b.normalColor)) ) | ||
{ | ||
colorBlock.normalColor = normalColor; | ||
} | ||
|
||
targetObject = colorBlock; | ||
if(ShouldApply(this.nameof(b => b.highlightedColor)) ) | ||
{ | ||
colorBlock.highlightedColor = highlightedColor; | ||
} | ||
|
||
if(ShouldApply(this.nameof(b => b.pressedColor)) ) | ||
{ | ||
colorBlock.pressedColor = pressedColor; | ||
} | ||
|
||
if(ShouldApply(this.nameof(b => b.disabledColor)) ) | ||
{ | ||
colorBlock.disabledColor = disabledColor; | ||
} | ||
|
||
if(ShouldApply(this.nameof(b => b.colorMultiplier)) ) | ||
{ | ||
colorBlock.colorMultiplier = colorMultiplier; | ||
} | ||
|
||
if(ShouldApply(this.nameof(b => b.fadeDuration)) ){ | ||
colorBlock.fadeDuration = fadeDuration; | ||
} | ||
|
||
targetObject = colorBlock; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
using Skinnable; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
[ExecuteInEditMode] | ||
public class ColorTheme : BaseStyle<Color> { | ||
public Color color = Color.white; | ||
public override void ApplyStyle (ref System.Object targetObject) { | ||
if(ShouldApply(nameof(color)) ) targetObject = color; | ||
} | ||
namespace Skinnable { | ||
|
||
public class ColorTheme : BaseStyle<Color> { | ||
public Color color = Color.white; | ||
public override void ApplyStyle (ref System.Object targetObject) { | ||
if(ShouldApply(this.nameof(b => b.color)) ) | ||
{ | ||
targetObject = color; | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
using Skinnable; | ||
using UnityEngine; | ||
|
||
public class FontTheme : BaseStyle<Font> { | ||
public Font font; | ||
namespace Skinnable { | ||
public class FontTheme : BaseStyle<Font> { | ||
public Font font; | ||
|
||
public override void ApplyStyle(ref object targetObject) | ||
{ | ||
if(ShouldApply(nameof(font)) ) targetObject = font; | ||
public override void ApplyStyle(ref object targetObject) | ||
{ | ||
if(ShouldApply(this.nameof(f => f.font)) ) | ||
{ | ||
targetObject = font; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
|
||
using Skinnable; | ||
|
||
public class SizeTheme : BaseStyle<int> { | ||
public int size; | ||
public override void ApplyStyle (ref System.Object targetObject) { | ||
if(ShouldApply(nameof(size)) ) targetObject = size; | ||
namespace Skinnable { | ||
public class SizeTheme : BaseStyle<int> { | ||
public int size; | ||
public override void ApplyStyle (ref System.Object targetObject) { | ||
if(ShouldApply(this.nameof(s => s.size)) ) | ||
{ | ||
targetObject = size; | ||
} | ||
} | ||
} | ||
} |
39 changes: 26 additions & 13 deletions
39
Assets/Skinnable/Scripts/DefaultThemes/SpriteStateTheme.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,34 @@ | ||
using Skinnable; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class SpriteStateTheme : BaseStyle<SpriteState> | ||
namespace Skinnable | ||
{ | ||
public Sprite highlightedSprite; | ||
public Sprite pressedSprite; | ||
public Sprite disabledSprite; | ||
|
||
public override void ApplyStyle(ref object targetObject) | ||
public class SpriteStateTheme : BaseStyle<SpriteState> | ||
{ | ||
SpriteState spriteState = (SpriteState) targetObject; | ||
if(ShouldApply(nameof(highlightedSprite)) ) spriteState.highlightedSprite = highlightedSprite; | ||
if(ShouldApply(nameof(pressedSprite)) ) spriteState.pressedSprite = pressedSprite; | ||
if(ShouldApply(nameof(disabledSprite)) ) spriteState.disabledSprite = disabledSprite; | ||
public Sprite highlightedSprite; | ||
public Sprite pressedSprite; | ||
public Sprite disabledSprite; | ||
|
||
public override void ApplyStyle(ref object targetObject) | ||
{ | ||
SpriteState spriteState = (SpriteState) targetObject; | ||
if(ShouldApply(this.nameof(st => st.highlightedSprite)) ) | ||
{ | ||
spriteState.highlightedSprite = highlightedSprite; | ||
} | ||
|
||
if(ShouldApply(this.nameof(st => st.pressedSprite)) ) | ||
{ | ||
spriteState.pressedSprite = pressedSprite; | ||
} | ||
|
||
if(ShouldApply(this.nameof(st => st.disabledSprite)) ) | ||
{ | ||
spriteState.disabledSprite = disabledSprite; | ||
} | ||
|
||
|
||
targetObject = spriteState; | ||
targetObject = spriteState; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.