Beispiel #1
0
    //Turns the string from the notification order into the appropriate method and variables.
    public void executeNotification(String notification)
    {
        //Debug.Log("Inside notificationExecution");
        if (!notification.Equals("None"))
        {
            //  Debug.Log("Inside notification !=null");
            notificationHandled = false;
            String            form     = notification.Substring(0, 3);
            String            type     = notification.Substring(3, 2);
            int               waitTime = rand.Next(5, 15);
            NotifFormDelegate del      = notif.enablePhoneOverlayNotification;;
            switch (form)
            {
            case "PHO":
                del = notif.enablePhoneOverlayNotification;
                break;

            case "PHB":
                del = notif.enablePhoneBoothNotification;
                break;

            case "WAT":
                del = notif.enableWatchNotification;
                break;

            case "POP":
                del = notif.enablePopUpNotification;
                break;

            default:
                break;
            }
            bool haptic = false;
            bool audio  = false;
            switch (type)
            {
            case "VI":
                //visual
                break;

            case "AV":
                //audio + visual
                audio = true;
                break;

            case "HV":
                //haptic + visual
                haptic = true;
                break;

            default:
                break;
            }
            // Debug.Log("haptic is :"+haptic);
            // Debug.Log("audio is :" + audio);
            StartCoroutine(waitThenShowNotif(del, waitTime, haptic, audio));
        }
        else
        {
            //Debug.Log("Inside notification is none");
            notif.onCurrentInteractionComplete();
        }
    }
Beispiel #2
0
    public IEnumerator waitThenShowNotif(NotifFormDelegate del, int seconds, bool haptic, bool audio)
    {
        yield return(new WaitForSeconds(seconds));

        del(haptic, audio);
    }