- Home /
How to make notification appear at certain time without having to press button again?
public void OnGUI()
{
if (GUILayout.Button("BUTTON)", GUILayout.Height(Screen.height * 0.13f), GUILayout.Width(Screen.width * 1f)))
{
if (DateTime.Now.Month == 10 && DateTime.Now.Day == 18)
{
NotificationManager.Send(TimeSpan.FromSeconds(1), "RANDOMTEXT ", "randomtext", new Color(1, 0.3f, 0.15f));
{
if (DateTime.Now.Month == 10 && DateTime.Now.Day == 18 && DateTime.Now.Hour == 20 && DateTime.Now.Minute == 20)
{
NotificationManager.Send(TimeSpan.FromSeconds(1), "RANDOMTEXT1", "randomtext1", new Color(1, 0.3f, 0.15f));
lets say that current date is December 18th, 19:20 now if i pressed the "BUTTON" i would get notification,but only the first one,but if i pressed "BUTTON" at December 18th,20:20 i would get both notifications ,so my question is how do i make it so that i get second notification after certain amount of hours/days/months (after 1hour in this example) ,instead of having to press "BUTTON" at exact time that is set in script to get both of them.
man it gets so hard when it comes to explaining what i want script to do -,-
Answer by OusedGames · Oct 19, 2016 at 01:55 AM
Check the time on Update() function!
If (the condition you need)
Call notification
Hope it works
Answer by avadoto · Oct 19, 2016 at 12:57 PM
.... i dont know how i didnt think about it:D. now i have another question, how do i make it so that i only receive 1 notification instead of multiple ones?
I would use ins$$anonymous$$d of OnGui:
Use UI Canvas
You will have much more control about what is enabled and what is disabled!!
Just by setting the notifications GameObjects True or False Hope it works