@@ -590,9 +590,21 @@ public void GameButtonTemplate(LootLocker.Extension.DataTypes.Game game, string
590
590
gameSelectorList . Add ( button ) ;
591
591
}
592
592
593
+ bool AtTarget ( EventBase eventBase )
594
+ {
595
+ #if UNITY_2023_1_OR_NEWER
596
+ if ( eventBase . propagationPhase == PropagationPhase . BubbleUp )
597
+ return true ;
598
+ #else
599
+ if ( eventBase . propagationPhase == PropagationPhase . AtTarget )
600
+ return true ;
601
+ #endif
602
+ return false ;
603
+ }
604
+
593
605
void OnGameSelected ( EventBase e )
594
606
{
595
- if ( e . propagationPhase != PropagationPhase . AtTarget )
607
+ if ( ! AtTarget ( e ) )
596
608
return ;
597
609
598
610
var target = e . target as Button ;
@@ -707,7 +719,6 @@ void APIKeyTemplate(KeyResponse key)
707
719
if ( button . name == LootLockerConfig . current . apiKey )
708
720
{
709
721
button . style . borderRightColor = button . style . borderLeftColor = button . style . borderTopColor = button . style . borderBottomColor = stage ;
710
- keyName . style . color = stage ;
711
722
}
712
723
713
724
button . AddToClassList ( "apikey" ) ;
@@ -725,7 +736,7 @@ void APIKeyTemplate(KeyResponse key)
725
736
726
737
void OnAPIKeySelected ( EventBase e )
727
738
{
728
- if ( e . propagationPhase != PropagationPhase . AtTarget )
739
+ if ( ! AtTarget ( e ) )
729
740
return ;
730
741
731
742
var target = e . target as Button ;
@@ -744,16 +755,14 @@ void SwapNewSelectedKey()
744
755
745
756
if ( key . name == LootLockerConfig . current . apiKey )
746
757
{
747
- key . style . backgroundColor = stage ;
748
-
758
+ key . style . borderRightColor = key . style . borderLeftColor = key . style . borderTopColor = key . style . borderBottomColor = stage ;
749
759
}
750
760
else
751
761
{
752
762
key . style . backgroundColor = defaultButton ;
753
763
}
754
764
}
755
765
}
756
-
757
766
void Logout ( )
758
767
{
759
768
loadingPage . style . display = DisplayStyle . Flex ;
@@ -765,6 +774,10 @@ void Logout()
765
774
loadingPage . style . display = DisplayStyle . None ;
766
775
SwapFlows ( activeFlow , loginFlow ) ;
767
776
}
777
+ private void OnDestroy ( )
778
+ {
779
+ LootLockerServerApi . ResetInstance ( ) ;
780
+ }
768
781
769
782
}
770
783
}
0 commit comments