Fixed Button texture swapping. Fixed Button scripts on scene change. Added buttons to scenes. Added SHEDITOR define for Managed #341

Merged
maverickdgg merged 17 commits from SP3-20-UI-System into main 2023-02-04 00:32:29 +08:00
2 changed files with 24 additions and 12 deletions
Showing only changes of commit 4a101d97c9 - Show all commits

View File

@ -117,10 +117,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke() public void Invoke()
{ {
foreach (CallbackAction action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction;
action.Invoke(); action.Invoke();
} }
catch (Exception e) catch (Exception e)
@ -203,10 +204,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1) public void Invoke(T1 t1)
{ {
foreach (CallbackAction<T1> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1>;
action.Invoke(t1); action.Invoke(t1);
} }
catch (Exception e) catch (Exception e)
@ -289,10 +291,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1, T2 t2) public void Invoke(T1 t1, T2 t2)
{ {
foreach (CallbackAction<T1, T2> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1, T2>;
action.Invoke(t1, t2); action.Invoke(t1, t2);
} }
catch (Exception e) catch (Exception e)
@ -375,10 +378,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1, T2 t2, T3 t3) public void Invoke(T1 t1, T2 t2, T3 t3)
{ {
foreach (CallbackAction<T1, T2, T3> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1, T2, T3>;
action.Invoke(t1, t2, t3); action.Invoke(t1, t2, t3);
} }
catch (Exception e) catch (Exception e)
@ -461,10 +465,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4) public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4)
{ {
foreach (CallbackAction<T1, T2, T3, T4> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1, T2, T3, T4>;
action.Invoke(t1, t2, t3, t4); action.Invoke(t1, t2, t3, t4);
} }
catch (Exception e) catch (Exception e)
@ -547,10 +552,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
{ {
foreach (CallbackAction<T1, T2, T3, T4, T5> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1, T2, T3, T4, T5>;
action.Invoke(t1, t2, t3, t4, t5); action.Invoke(t1, t2, t3, t4, t5);
} }
catch (Exception e) catch (Exception e)
@ -633,10 +639,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)
{ {
foreach (CallbackAction<T1, T2, T3, T4, T5, T6> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1, T2, T3, T4, T5, T6>;
action.Invoke(t1, t2, t3, t4, t5, t6); action.Invoke(t1, t2, t3, t4, t5, t6);
} }
catch (Exception e) catch (Exception e)
@ -719,10 +726,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7)
{ {
foreach (CallbackAction<T1, T2, T3, T4, T5, T6, T7> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1, T2, T3, T4, T5, T6, T7>;
action.Invoke(t1, t2, t3, t4, t5, t6, t7); action.Invoke(t1, t2, t3, t4, t5, t6, t7);
} }
catch (Exception e) catch (Exception e)
@ -805,10 +813,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8) public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8)
{ {
foreach (CallbackAction<T1, T2, T3, T4, T5, T6, T7, T8> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1, T2, T3, T4, T5, T6, T7, T8>;
action.Invoke(t1, t2, t3, t4, t5, t6, t7, t8); action.Invoke(t1, t2, t3, t4, t5, t6, t7, t8);
} }
catch (Exception e) catch (Exception e)
@ -891,10 +900,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9) public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9)
{ {
foreach (CallbackAction<T1, T2, T3, T4, T5, T6, T7, T8, T9> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1, T2, T3, T4, T5, T6, T7, T8, T9>;
action.Invoke(t1, t2, t3, t4, t5, t6, t7, t8, t9); action.Invoke(t1, t2, t3, t4, t5, t6, t7, t8, t9);
} }
catch (Exception e) catch (Exception e)
@ -977,10 +987,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10) public void Invoke(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10)
{ {
foreach (CallbackAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>;
action.Invoke(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); action.Invoke(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
} }
catch (Exception e) catch (Exception e)

View File

@ -134,10 +134,11 @@ namespace SHADE
/// </summary> /// </summary>
public void Invoke(<# if (i != 0) { for (int t = 1; t < i + 1; ++t) { #>T<#=t#> t<#=t#><# if (t != i) { #>, <# } #><# } } #>) public void Invoke(<# if (i != 0) { for (int t = 1; t < i + 1; ++t) { #>T<#=t#> t<#=t#><# if (t != i) { #>, <# } #><# } } #>)
{ {
foreach (CallbackAction<# if (i != 0) { #><<# for (int t = 1; t < i + 1; ++t) { #>T<#=t#><# if (t != i) { #>, <# } #><# } #>><# } #> action in actions) for (int i = 0; i < actions.Count; ++i)
{ {
try try
{ {
var action = actions[i] as CallbackAction<# if (i != 0) { #><<# for (int t = 1; t < i + 1; ++t) { #>T<#=t#><# if (t != i) { #>, <# } #><# } #>><# } #>;
action.Invoke(<# for (int t = 1; t < i + 1; ++t) { #>t<#=t#><# if (t != i) { #>, <# } #><# } #>); action.Invoke(<# for (int t = 1; t < i + 1; ++t) { #>t<#=t#><# if (t != i) { #>, <# } #><# } #>);
} }
catch (Exception e) catch (Exception e)