File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,12 @@ public class Notifications : MonoBehaviour
3636 [ SerializeField ] private GameObject notificationPrefab ;
3737#pragma warning restore CS0649
3838
39- public Func < string , string > TranslationFunction { set ; private get ; }
39+ public static Func < string , string > TranslationFunction
40+ {
41+ set => instance . translationFunction = value ;
42+ }
43+
44+ private Func < string , string > translationFunction ;
4045
4146 // Singleton design, assigned in Awake().
4247 private static Notifications instance ;
@@ -233,9 +238,9 @@ private void SendNotification(Notification notification)
233238 var rect = notificationGameObject . GetComponent < RectTransform > ( ) ;
234239
235240 var message = notification . Message ;
236- if ( TranslationFunction != null )
241+ if ( translationFunction != null )
237242 {
238- message = TranslationFunction ( message ) ;
243+ message = translationFunction ( message ) ;
239244 }
240245 notificationGameObject . GetComponent < NotificationUI > ( ) . SetUp ( message , GetColor ( notification . Type ) , notification . OnClickEvent ) ;
241246
You can’t perform that action at this time.
0 commit comments