Player message center.
Inheritance: GUIObject
示例#1
0
文件: Plugin.cs 项目: nbhopson/QMail
        private void onMailAudited(string sender, ime.notification.NotifyMessage e, NotificationCenter.Stage stage)
        {
            if (stage == NotificationCenter.Stage.Receiving)
            {
                Application.Current.Dispatcher.Invoke((System.Action)delegate
                {
                    if (!DBWorker.IsDBCreated())
                        return;
                    XElement xml = e.Body as XElement;
                    if (xml == null)
                        return;
                    XElement msgXml = xml.Element("message");
                    if (msgXml == null)
                        return;

                    ASObject mail = new ASObject();
                    mail["uuid"] = msgXml.AttributeValue("uuid");
                    mail["folder"] = "SENDED";
                    MailWorker.instance.updateMailRecord(mail, new string[] { "folder" });
                    MailWorker.instance.dispatchMailEvent(MailWorker.Event.Reset, null, null);
                    Application.Current.Dispatcher.Invoke((System.Action)delegate
                    {
                        e.Show();
                    }, System.Windows.Threading.DispatcherPriority.ApplicationIdle);
                }, System.Windows.Threading.DispatcherPriority.ApplicationIdle);
            }
        }
 void InvisibilityTriggered(NotificationCenter.Notification notif)
 {
     StopRunningCoroutines();
     Hashtable payload = notif.data;
     gameObject.GetComponent<Renderer>().material = (Material)payload["material"];
     Coroutine coroutine = StartCoroutine(SwitchBackMaterial((float)payload["duration"]));
     AddPowerUpCoroutineToList(coroutine);
 }
 public NotificationCenter()
 {
     if (instance != null)
     {
         Debug.Log("NotificationCenter instance is not null");
         return;
     }
     instance = this;
 }
    void Explode(NotificationCenter.Notification notif)
    {
        Hashtable payload = notif.data;

        Debug.LogWarning ("Explode notif");

        //check if the notification is for us
        if(payload["explosion"] != this.gameObject)
            return;

        float multiplier = GetComponent<ParticleSystemMultiplier>().multiplier;
        //pushed NPCs contains killed NPCs
        var pushedGO = Physics.OverlapSphere(transform.position, pushRadius);
        var killedGO = Physics.OverlapSphere(transform.position, killRadius);

        Debug.LogWarning ("Exploded");

        //push all the NPCs in the push radius
        var pushedRigidbodies = new List<Rigidbody>();
        foreach (var col in pushedGO)
        {

            if (col.attachedRigidbody != null && !pushedRigidbodies.Contains(col.attachedRigidbody))
            {
                if(col.gameObject.CompareTag("NPC") || col.gameObject.CompareTag("Player") )
                    pushedRigidbodies.Add(col.attachedRigidbody);
            }
        }
        foreach (var rb in pushedRigidbodies)
        {
            rb.AddExplosionForce(explosionForce*multiplier, transform.position, pushRadius, multiplier, ForceMode.Impulse);
        }

        //trigger kill method on killedNPCs
        var killedRigidbodies = new List<Rigidbody>();
        foreach (var col in killedGO)
        {
            if (col.attachedRigidbody != null && !killedRigidbodies.Contains(col.attachedRigidbody))
            {
                if(col.gameObject.CompareTag("NPC") || col.gameObject.CompareTag("Player") )
                    killedRigidbodies.Add(col.attachedRigidbody);
            }
        }
        foreach (var rb in killedRigidbodies)
        {

            if(rb.gameObject.CompareTag("NPC")){
                //rb.gameObject.GetComponent<AIScript>().;
                rb.gameObject.SetActive(false);
            }

            if(rb.gameObject.CompareTag("Player")){
                //rb.gameObject.SetActive(false);
            }
        }
    }
示例#5
0
        public DefaultAppImp()
        {
            m_timerManager = CreateTimerManager();
            m_notificationCenter = CreateNotificationCenter();
            m_processor = CreateCommandProcessor();

            m_updatables = new UpdatableList(2);
            m_updatables.Add(m_timerManager);
            m_updatables.Add(UpdateBindings);
        }
 public static NotificationCenter DefaultCenter()
 {
     if (!defaultCenter)
     {
         GameObject notificationObject = new GameObject("Default Notification Center");
         defaultCenter = notificationObject.AddComponent<NotificationCenter>();
         DontDestroyOnLoad(defaultCenter);
     }
     return defaultCenter;
 }
 //获取实力句柄
 private static NotificationCenter GetInstance()
 {
     if(instance == null)
     {
         GameObject mount = new GameObject();
         mount.name = "NotificationCenter";
         instance = mount.AddComponent<NotificationCenter>();
     }
     return instance;
 }
示例#8
0
 void OnCollectGems(NotificationCenter.Notification n)
 {
     //		GameManager m = n.sender as GameManager;
     //		List<Slot> s = n.data["slots"] as List<Slot>;
     //
     //		foreach (Slot slot in s )
     //		{
     //			Debug.Log("Animoidaan " );
     //			iTween.MoveBy(slot.crate.gameObject, new Vector3(1,1,0), 3);
     //		}
     //m.gameMode
 }
示例#9
0
 //Used for transfering song demo info to AudioController
 public void GetDemoInfo(NotificationCenter.Notification notification)
 {
     Hashtable messageData = new Hashtable();
     foreach (SongItem song in m_songList) {
         if(song.id == (string)notification.data["songId"]){
             messageData.Add("demoOffset", song.demoOffset);
             messageData.Add("demoDuration", song.demoDuration);
             NotificationCenter.DefaultCenter.PostNotification(this, "SetDemoInfo", messageData);
             break;
         }
     }
 }
示例#10
0
	public static NotificationCenter DefaultCenter () {
	    // If the defaultCenter doesn't already exist, we need to create it
	    if (!defaultCenter) {
	        // Because the NotificationCenter is a component, we have to create a GameObject to attach it to.
	        GameObject notificationObject = new GameObject("Default Notification Center");
	        // Add the NotificationCenter component, and set it as the defaultCenter
	        defaultCenter = notificationObject.AddComponent<NotificationCenter>();
			DontDestroyOnLoad(defaultCenter);
	    }
 
	    return defaultCenter;
	}
        public void TestPost0()
        {
            TimerManager timerManager = new TimerManager();

            List<String> result = new List<String>();

            notifications = new NotificationCenter(timerManager);
            notifications.Register("name", Callback1);
            notifications.Register("name", Callback2);
            notifications.Register("name", Callback3);

            notifications.Post(this, "name", result);

            Check(result);
            Assert.AreEqual(timerManager.Count(), 1);

            timerManager.Update(0.016f);

            Check(result, "Callback1", "Callback2", "Callback3");
            Assert.AreEqual(timerManager.Count(), 0);
        }
 void Awake()
 {
     NotificationCenter.AddObserver(JumpNow, Notification.AnyKey);
 }
示例#13
0
 private void Start()
 {
     NotificationCenter.AddListener <StatChange> (OnStatChange);
 }
示例#14
0
 public ElementoInteractivo BotonSaltoDisparo;//Referencias a los botones del juego(ANDROID)
 void Start()
 {
     NotificationCenter.DefaultCenter().AddObserver(this, "PermisivoSalto");//Nos inscribimos a la notificacion que indica que el personaje a llegado de una base a otra
 }
示例#15
0
	/// <summary>
	/// Initializes a new instance of the <see cref="NotificationCenter"/> class.
	/// </summary>
	public NotificationCenter(){
		use = this;
		m_rect.width = Screen.width * 0.25f;
		m_rect.x = Screen.width - rect.width - m_box.margin.right;
		m_rect.y = m_box.margin.top;
	}
示例#16
0
        private void UpdateFileList(CShItem folder, ListView listView, bool refreshThumbnails, bool shortcuts)
        {
            // Update a file list with the given folder.
            // Triggers an update of the thumbnails pane if requested.
            if (folder == null)
            {
                return;
            }

            this.Cursor = Cursors.WaitCursor;

            listView.BeginUpdate();
            listView.View = View.Details;
            listView.Items.Clear();
            listView.Columns.Clear();
            listView.Columns.Add("", listView.Width);
            listView.GridLines   = true;
            listView.HeaderStyle = ColumnHeaderStyle.None;

            // Each list element will store the CShItem it's referring to in its Tag property.
            ArrayList fileList = folder.GetFiles();

            List <string> filenames = new List <string>();

            foreach (object item in fileList)
            {
                CShItem shellItem = item as CShItem;
                if (shellItem == null)
                {
                    continue;
                }

                try
                {
                    string path      = shellItem.Path;
                    string extension = Path.GetExtension(path);
                    if (string.IsNullOrEmpty(extension) || !VideoTypeManager.IsSupported(extension))
                    {
                        continue;
                    }

                    filenames.Add(path);
                }
                catch (Exception)
                {
                    // Known case : when we are in OS/X parallels context, the path of existing files are invalid.
                    log.ErrorFormat("An error happened while trying to add a file to the file list : {0}", shellItem.Path);
                }
            }

            filenames.Sort(new AlphanumComparator());

            foreach (string filename in filenames)
            {
                ListViewItem lvi = new ListViewItem(Path.GetFileName(filename));
                lvi.Tag        = filename;
                lvi.ImageIndex = 0;
                listView.Items.Add(lvi);
            }

            listView.EndUpdate();

            UpdateFileWatcher(folder);

            // Even if we don't want to reload the thumbnails, we must ensure that
            // the screen manager backup list is in sync with the actual file list.
            // desync can happen in case of renaming and deleting files.
            // the screenmanager backup list is used at BringBackThumbnail,
            // (i.e. when we close a screen)
            NotificationCenter.RaiseCurrentDirectoryChanged(this, shortcuts, filenames, refreshThumbnails);
            this.Cursor = Cursors.Default;
        }
示例#17
0
 void set_fuel_to(NotificationCenter.Notification notification)
 {
     FuelValue.text = string.Format ("{0:0}", (float)notification.data ["value"]);
 }
示例#18
0
        private void onSubscribe(string sender, ime.notification.NotifyMessage e, NotificationCenter.Stage stage)
        {
            if (isJoinAccept)
                return;
            if (stage == NotificationCenter.Stage.Receiving)
            {
                XElement xml = e.Body as XElement;
                if (xml == null)
                    return;
                XElement subscribe = xml.Element("subscribe");
                if (subscribe == null)
                    return;

                if (subscribe.AttributeValue("principal") == Desktop.instance.loginedPrincipal.loginId)
                    return;

                string type = subscribe.AttributeValue("type");
                if (type == "accept_mail")
                {
                    workInfo.SetInfo(subscribe.AttributeValue("principal_name") + "邮件账户" + subscribe.AttributeValue("account") + subscribe.AttributeValue("subject"));
                    workInfo.SetProgress(NumberUtil.parseInt(subscribe.AttributeValue("total")), NumberUtil.parseInt(subscribe.AttributeValue("count")));
                    if (subscribe.AttributeValue("detail") == "true")
                        workInfo.AddDetail(subscribe.AttributeValue("principal_name") + "邮件账户" + subscribe.AttributeValue("subject"), Colors.Black);
                }
                else if (type == "accept_mail_stram")
                {
                    workInfo.SetItemProgress(NumberUtil.parseInt(subscribe.AttributeValue("total")), NumberUtil.parseInt(subscribe.AttributeValue("count")));
                }
            }
        }
示例#19
0
 void Awake()
 {
     defaultCenter = this;
 }
        public void TestPostImmediately7()
        {
            List<String> result = new List<String>();

            notifications = new NotificationCenter(new TimerManager());
            notifications.Register("name", Callback4);
            notifications.Register("name", Callback1);
            notifications.Register("name", Callback5);
            notifications.Register("name", Callback3);

            notifications.PostImmediately(this, "name", result);

            Check(result, "Callback4", "Callback5");
        }
        public void TestPostImmediately6()
        {
            List<String> result = new List<String>();

            Dummy dummy = new Dummy();

            notifications = new NotificationCenter(new TimerManager());
            notifications.Register("name", Callback1);
            notifications.Register("name", dummy.Callback1);
            notifications.Register("name", Callback2);
            notifications.Register("name", dummy.Callback2);
            notifications.Register("name", Callback3);
            notifications.Register("name", dummy.Callback3);

            notifications.PostImmediately(this, "name", result);

            Check(result, "Callback1", "Dummy1", "Callback2", "Dummy2", "Callback3", "Dummy3");
            notifications.UnregisterAll(this);

            notifications.PostImmediately(this, "name", result);
            Check(result, "Dummy1", "Dummy2", "Dummy3");
        }
        public void TestPostImmediately0()
        {
            List<String> result = new List<String>();

            notifications = new NotificationCenter(new TimerManager());
            notifications.PostImmediately(this, "name", result);

            Check(result);
        }
示例#23
0
 void Awake()
 {
     if(instance)
         DestroyImmediate(gameObject);
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
示例#24
0
 public void SendNotification(string name, object data = null)
 {
     NotificationCenter.GetInstance().SendNotification(name, data);
 }
示例#25
0
 void OnTriggerExit2D(Collider2D col)
 {
     NotificationCenter.GetInstance().PostNotification("ScoreAdd");
 }
示例#26
0
文件: GUIM_Hud.cs 项目: JordanBird/DD
 public void PlayerAmmoChanged(NotificationCenter.Notification noti)
 {
     ammo.text = noti.data;
 }
示例#27
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancelBeforeShow"></param>
        protected internal virtual bool ShowNow(NotificationRequest request, bool cancelBeforeShow)
        {
            if (cancelBeforeShow)
            {
                Cancel(request.NotificationId);
            }

            if (string.IsNullOrWhiteSpace(request.Android.ChannelId))
            {
                request.Android.ChannelId = NotificationCenter.DefaultChannelId;
            }

            using var builder = new NotificationCompat.Builder(Application.Context, request.Android.ChannelId);
            builder.SetContentTitle(request.Title);
            builder.SetContentText(request.Description);
            using (var bigTextStyle = new NotificationCompat.BigTextStyle())
            {
                var bigText = bigTextStyle.BigText(request.Description);
                builder.SetStyle(bigText);
            }
            builder.SetNumber(request.BadgeNumber);
            builder.SetAutoCancel(request.Android.AutoCancel);
            builder.SetOngoing(request.Android.Ongoing);

            if (string.IsNullOrWhiteSpace(request.Android.Group) == false)
            {
                builder.SetGroup(request.Android.Group);
                if (request.Android.IsGroupSummary)
                {
                    builder.SetGroupSummary(true);
                }
            }

            if (Build.VERSION.SdkInt < BuildVersionCodes.O)
            {
                builder.SetPriority((int)request.Android.Priority);

                var soundUri = NotificationCenter.GetSoundUri(request.Sound);
                if (soundUri != null)
                {
                    builder.SetSound(soundUri);
                }
            }

            if (request.Android.VibrationPattern != null)
            {
                builder.SetVibrate(request.Android.VibrationPattern);
            }

            if (request.Android.ProgressBarMax.HasValue &&
                request.Android.ProgressBarProgress.HasValue &&
                request.Android.ProgressBarIndeterminate.HasValue)
            {
                builder.SetProgress(request.Android.ProgressBarMax.Value,
                                    request.Android.ProgressBarProgress.Value,
                                    request.Android.ProgressBarIndeterminate.Value);
            }

            if (request.Android.Color.HasValue)
            {
                builder.SetColor(request.Android.Color.Value);
            }

            builder.SetSmallIcon(GetIcon(request.Android.IconName));
            if (request.Android.TimeoutAfter.HasValue)
            {
                builder.SetTimeoutAfter((long)request.Android.TimeoutAfter.Value.TotalMilliseconds);
            }

            var notificationIntent = Application.Context.PackageManager?.GetLaunchIntentForPackage(Application.Context.PackageName ?? string.Empty);

            if (notificationIntent is null)
            {
                Log($"NotificationServiceImpl.ShowNow: notificationIntent is null");
                return(false);
            }

            notificationIntent.SetFlags(ActivityFlags.SingleTop);
            notificationIntent.PutExtra(NotificationCenter.ExtraReturnDataAndroid, request.ReturningData);
            var pendingIntent = PendingIntent.GetActivity(Application.Context, request.NotificationId, notificationIntent,
                                                          PendingIntentFlags.CancelCurrent);

            builder.SetContentIntent(pendingIntent);

            var notification = builder.Build();

            if (Build.VERSION.SdkInt < BuildVersionCodes.O &&
                request.Android.LedColor.HasValue)
            {
                notification.LedARGB = request.Android.LedColor.Value;
            }

            if (Build.VERSION.SdkInt < BuildVersionCodes.O &&
                string.IsNullOrWhiteSpace(request.Sound))
            {
                notification.Defaults = NotificationDefaults.All;
            }
            NotificationManager?.Notify(request.NotificationId, notification);

            var args = new NotificationReceivedEventArgs
            {
                Title       = request.Title,
                Description = request.Description,
                Data        = request.ReturningData
            };

            NotificationCenter.Current.OnNotificationReceived(args);

            return(true);
        }
示例#28
0
文件: GUIM_Hud.cs 项目: JordanBird/DD
 public void PlayerHealthChanged(NotificationCenter.Notification noti)
 {
     health.text = noti.data;
 }
示例#29
0
 void InvisibilityTriggered(NotificationCenter.Notification notif)
 {
     Hashtable payload = notif.data;
     StartCoroutine(Invis((float)payload["duration"]));
 }
示例#30
0
        private void ShowNow(NotificationRequest request)
        {
            Cancel(request.NotificationId);

            if (string.IsNullOrWhiteSpace(request.Android.ChannelId))
            {
                request.Android.ChannelId = NotificationCenter.DefaultChannelId;
            }

            using (var builder = new NotificationCompat.Builder(Application.Context, request.Android.ChannelId))
            {
                builder.SetContentTitle(request.Title);
                builder.SetContentText(request.Description);
                using (var bigTextStyle = new NotificationCompat.BigTextStyle())
                {
                    var bigText = bigTextStyle.BigText(request.Description);
                    builder.SetStyle(bigText);
                }
                builder.SetNumber(request.BadgeNumber);
                builder.SetAutoCancel(request.Android.AutoCancel);
                builder.SetOngoing(request.Android.Ongoing);

                if (Build.VERSION.SdkInt < BuildVersionCodes.O)
                {
                    builder.SetPriority((int)request.Android.Priority);

                    var soundUri = NotificationCenter.GetSoundUri(request.Sound);
                    if (soundUri != null)
                    {
                        builder.SetSound(soundUri);
                    }
                }

                if (request.Android.VibrationPattern != null)
                {
                    builder.SetVibrate(request.Android.VibrationPattern);
                }

                if (request.Android.ProgressBarMax.HasValue &&
                    request.Android.ProgressBarProgress.HasValue &&
                    request.Android.ProgressBarIndeterminate.HasValue)
                {
                    builder.SetProgress(request.Android.ProgressBarMax.Value,
                                        request.Android.ProgressBarProgress.Value,
                                        request.Android.ProgressBarIndeterminate.Value);
                }

                if (request.Android.Color.HasValue)
                {
                    builder.SetColor(request.Android.Color.Value);
                }

                builder.SetSmallIcon(GetIcon(request.Android.IconName));
                if (request.Android.TimeoutAfter.HasValue)
                {
                    builder.SetTimeoutAfter((long)request.Android.TimeoutAfter.Value.TotalMilliseconds);
                }

                var notificationIntent =
                    Application.Context.PackageManager.GetLaunchIntentForPackage(Application.Context.PackageName);
                notificationIntent.SetFlags(ActivityFlags.SingleTop);
                notificationIntent.PutExtra(NotificationCenter.ExtraReturnDataAndroid, request.ReturningData);
                var pendingIntent = PendingIntent.GetActivity(Application.Context, 0, notificationIntent,
                                                              PendingIntentFlags.UpdateCurrent);
                builder.SetContentIntent(pendingIntent);

                var notification = builder.Build();
                if (request.Android.LedColor.HasValue)
                {
                    notification.LedARGB = request.Android.LedColor.Value;
                }

                if (Build.VERSION.SdkInt < BuildVersionCodes.O &&
                    string.IsNullOrWhiteSpace(request.Sound))
                {
                    notification.Defaults = NotificationDefaults.All;
                }

                _notificationManager.Notify(request.NotificationId, notification);
            }
        }
示例#31
0
 void set_sady_to(NotificationCenter.Notification notification)
 {
     SadyValue.text = string.Format ("{0:0}/{1:0}", (int)notification.data ["value"], (int)notification.data ["total_value"]);
 }
 void start_game_reset(NotificationCenter.Notification notification)
 {
     Debug.Log ("start_game_reset @ NoFuelCheckerController");
     ResetPassCheck ();
 }
示例#33
0
 void Start()
 {
     if (_defaultInstance == null)
     {
         _defaultInstance = this;
     }
     if (!destroyOnLoad)
     {
         GameObject.DontDestroyOnLoad (gameObject);
     }
 }
示例#34
0
 public void OnApplicationQuit ()
 {
     instance = null;
 }
示例#35
0
 // Use this for initialization
 void Start()
 {
     NotificationCenter.DefaultCenter().AddObserver(this, "MarquezCatch");
 }
示例#36
0
 // Use this for initialization
 void Start()
 {
     NotificationCenter.DefaultCenter().AddObserver(this, "PersonajeHaMuerto");
 }
示例#37
0
 void Awake()
 {
     NotificationCenter.DefaultCenter().AddObserver(this, "OnDead");
 }
示例#38
0
 // Start is called before the first frame update
 void Start()
 {
     NotificationCenter.DefaultCenter().AddObserver(this, "addPoints");
 }
示例#39
0
 public void OnDestroy()
 {
     NotificationCenter.RemoveListener <StatChange> (OnStatChange);
 }
示例#40
0
    public override void gaxb_complete()
    {
        base.gaxb_complete();

        // At this point, our gameObject is our "text" game object.  We want to maneuver things around
        // until its like:
        // --> TMPro - Input Field
        //   --> Text Area
        //      --> Placeholder
        //      --> Text


        // 0) first, swap out our TMPro text and replace our gameObject with one with the text field
        GameObject textGameObject = gameObject;

        // Next, we create a new gameObject, and put the Text-created gameObject inside me
        gameObject = new GameObject("<TMP_InputField/>", typeof(RectTransform));
        gameObject.transform.SetParent(textGameObject.transform.parent, false);
        UpdateRectTransform();


        // 0.5) Create a game object for the field
        inputField       = new PUGameObject();
        inputField.title = "TMP_InputField";
        inputField.SetFrame(0, 0, 0, 0, 0, 0, "stretch,stretch");
        inputField.LoadIntoPUGameObject(this);

        // 1) create the hierarchy of stuff under me
        textArea       = new PUGameObject();
        textArea.title = "Text Area";
        textArea.SetFrame(0, 0, 0, 0, 0, 0, "stretch,stretch");
        textArea.LoadIntoPUGameObject(inputField);

        // 2) placeholder
        if (placeholder != null)
        {
            placeholderText       = new PUTMPro();
            placeholderText.title = "Placeholder";
            placeholderText.value = this.placeholder;
            placeholderText.LoadIntoPUGameObject(textArea);

            placeholderText.textGUI.overflowMode = this.textGUI.overflowMode;

            placeholderText.textGUI.alignment   = this.textGUI.alignment;
            placeholderText.textGUI.font        = this.textGUI.font;
            placeholderText.textGUI.fontSize    = this.textGUI.fontSize;
            placeholderText.textGUI.fontStyle   = this.textGUI.fontStyle;
            placeholderText.textGUI.color       = this.textGUI.color - new Color(0, 0, 0, 0.5f);
            placeholderText.textGUI.lineSpacing = this.textGUI.lineSpacing;

            placeholderText.gameObject.FillParentUI();
        }

        // 3) text
        text = new PUGameObject();
        text.SetFrame(0, 0, 0, 0, 0, 0, "stretch,stretch");
        text.LoadIntoPUGameObject(textArea);

        GameObject.Destroy(text.gameObject);
        text.gameObject = textGameObject;

        // Move the text to be the child of the input field
        textGameObject.name = "Text";
        textGameObject.transform.SetParent(textArea.rectTransform, false);
        textGameObject.FillParentUI();
        (textGameObject.transform as RectTransform).pivot = Vector2.zero;


        // now that we have the hierarchy, fille out the input field
        field = inputField.gameObject.AddComponent <TMP_InputField> ();

        field.transition = Selectable.Transition.None;

        field.targetGraphic = inputField.gameObject.AddComponent <InvisibleHitGraphic> ();
        field.textViewport  = textArea.rectTransform;
        field.textComponent = textGUI;

        if (asteriskChar != null)
        {
            field.asteriskChar = asteriskChar.Value;
        }

        if (contentType == PlanetUnity2.InputFieldContentType.standard)
        {
            field.contentType = TMP_InputField.ContentType.Standard;
        }
        else if (contentType == PlanetUnity2.InputFieldContentType.autocorrected)
        {
            field.contentType = TMP_InputField.ContentType.Autocorrected;
        }
        else if (contentType == PlanetUnity2.InputFieldContentType.integer)
        {
            field.contentType = TMP_InputField.ContentType.IntegerNumber;
        }
        else if (contentType == PlanetUnity2.InputFieldContentType.number)
        {
            field.contentType = TMP_InputField.ContentType.DecimalNumber;
        }
        else if (contentType == PlanetUnity2.InputFieldContentType.alphanumeric)
        {
            field.contentType = TMP_InputField.ContentType.Alphanumeric;
        }
        else if (contentType == PlanetUnity2.InputFieldContentType.name)
        {
            field.contentType = TMP_InputField.ContentType.Name;
        }
        else if (contentType == PlanetUnity2.InputFieldContentType.email)
        {
            field.contentType = TMP_InputField.ContentType.EmailAddress;
        }
        else if (contentType == PlanetUnity2.InputFieldContentType.password)
        {
            field.contentType = TMP_InputField.ContentType.Password;
            field.inputType   = TMP_InputField.InputType.Password;
        }
        else if (contentType == PlanetUnity2.InputFieldContentType.pin)
        {
            field.contentType = TMP_InputField.ContentType.Pin;
        }
        else if (contentType == PlanetUnity2.InputFieldContentType.custom)
        {
            field.contentType = TMP_InputField.ContentType.Custom;

            field.onValidateInput += ValidateInput;
        }

        if (lineType == PlanetUnity2.InputFieldLineType.single)
        {
            field.lineType = TMP_InputField.LineType.SingleLine;
        }
        else if (lineType == PlanetUnity2.InputFieldLineType.multiSubmit)
        {
            field.lineType = TMP_InputField.LineType.MultiLineSubmit;
        }
        else if (lineType == PlanetUnity2.InputFieldLineType.multiNewline)
        {
            field.lineType = TMP_InputField.LineType.MultiLineNewline;
        }

        if (characterLimit != null)
        {
            field.characterLimit = (int)characterLimit;
        }

        if (selectionColor != null)
        {
            field.selectionColor = selectionColor.Value;
        }

        // This is probably not the best way to do this, but 4.60.f1 removed the onSubmit event
        field.onEndEdit.AddListener((value) => {
            if (onValueChanged != null)
            {
                NotificationCenter.postNotification(Scope(), this.onValueChanged, NotificationCenter.Args("sender", this));
            }
        });

        foreach (Object obj in gameObject.GetComponentsInChildren <DetectTextClickTMPro>())
        {
            GameObject.Destroy(obj);
        }

        if (this.value == null)
        {
            this.value = "";
        }

        field.text = this.value;

        if (placeholder != null)
        {
            field.placeholder = placeholderText.textGUI;
        }
    }
示例#41
0
 void OnDestroy()
 {
     NotificationCenter.removeCompletely(this);
 }
示例#42
0
 // Use this for initialization
 void Start()
 {
     NotificationCenter.DefaultCenter().AddObserver(this, "GO");
     NotificationCenter.DefaultCenter().AddObserver(this, "termino");
     NotificationCenter.DefaultCenter().AddObserver(this, "frenar");
 }
示例#43
0
    // Use this for initialization

    void Awake()
    {
        currentDescription = MissionDescription[0];
        NotificationCenter.getInstance().AddNotification(NotifyType.Main_Mission_Passed, null);
        NotificationCenter.getInstance().registerObserver(NotifyType.Main_Mission_Passed, UpdateDescription);
    }
示例#44
0
    // Update is called once per frame
    void Update()
    {
        if (perdisteamigo == false)
        {
            timer -= Time.deltaTime;
            if (timer <= 0)
            {
                puntos++;
                Puntuacion_txt.text = ((int)puntos).ToString();
                timer = tiempito;
            }
        }
        else
        {
            Puntuacion_txt.text = "";
            if (contpuntos < (int)puntos)
            {
                contpuntos++;
                PuntosGameOver.text = contpuntos.ToString();
            }
            if ((int)puntos > DatosPrinc.record[9] && paso == false)
            {
                nombrecitos.SetActive(true);
                //NotificationCenter.DefaultCenter ().PostNotification (this,"Record",(int)puntos);
                if ((int)puntos > DatosPrinc.record[0])
                {
                    RecordGameOver.text = puntos.ToString();
                }
                aRecord = true;
                paso    = true;
            }
            if ((int)puntos < DatosPrinc.record[9])
            {
                RecordGameOver.text = DatosPrinc.record[0].ToString();
            }

            /*if (Input.inputString != "") {
             *      int asciicode = System.Convert.ToInt32 (Input.inputString [0]);
             *      char num = (char)asciicode;
             *      lalo = num.ToString ();
             *      Debug.Log (lalo);
             * }*/
            char num = (char)yo;
            lalo = num.ToString();
            letras[letr].text = lalo;
            if (Input.GetKeyDown(KeyCode.DownArrow))
            {
                yo += 1;
                if (yo > 90)
                {
                    yo = 49;
                }
                if (yo > 57 && yo < 65)
                {
                    yo = 65;
                }
                nombre = "" + letras[0].text + "" + letras[1].text + "" + letras[2].text;
                Debug.Log(nombre);
                Debug.Log(yo);
            }
            if (Input.GetKeyDown(KeyCode.UpArrow))
            {
                yo -= 1;
                if (yo < 49)
                {
                    yo = 90;
                }
                if (yo > 57 && yo < 65)
                {
                    yo = 57;
                }
                nombre = "" + letras[0].text + "" + letras[1].text + "" + letras[2].text;
                Debug.Log(nombre);
                // 32 a 126
                // de 90 a 49
                // de 57 a 65
                Debug.Log(yo);
            }
            if (Input.GetKeyDown(KeyCode.LeftControl))
            {
                if (aRecord == true)
                {
                    letr += 1;
                    if (letr == 1)
                    {
                        flechas.SetBool("mover1", true);
                        yo = 65;
                    }
                    if (letr == 2)
                    {
                        flechas.SetBool("mover2", true);
                        yo = 65;
                    }
                    if (letr > 2)
                    {
                        NotificationCenter.DefaultCenter().PostNotification(this, "Recordnum", (int)puntos);
                        NotificationCenter.DefaultCenter().PostNotification(this, "Recordnom", nombre);
                        puntos = 0;
                        Destroy(GameOver.gameObject);
                        Destroy(this.gameObject);
                        SceneManager.LoadScene("Records");
                    }
                }
                else
                {
                    puntos = 0;
                    Destroy(GameOver.gameObject);
                    Destroy(this.gameObject);
                    SceneManager.LoadScene("Menu");
                }
            }
        }
    }
 protected override void OnNewIntent(Intent intent)
 {
     NotificationCenter.NotifyNotificationTapped(intent);
     base.OnNewIntent(intent);
 }
 void Start()
 {
     Instantiate(Enemy, spawnPoint.position, spawnPoint.rotation);
     NotificationCenter.DefaultCenter().AddObserver(this, "AnotherEnemy");
 }
示例#47
0
 public void SetSong(NotificationCenter.Notification notification)
 {
     SetSongInfo ((string)notification.data["songid"], (float)notification.data["length"]);
 }
示例#48
0
 // Use this for initialization
 void Start()
 {
     //Generar();
     NotificationCenter.DefaultCenter().AddObserver(this, "PersonajeEmpiezaACorrer");
     NotificationCenter.DefaultCenter().AddObserver(this, "PersonajeHaMuerto");
 }
        /// <inheritdoc />
        public async void Show(NotificationRequest notificationRequest)
        {
            UNNotificationTrigger trigger = null;

            try
            {
                if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0) == false)
                {
                    return;
                }

                if (notificationRequest is null)
                {
                    return;
                }

                var allowed = await NotificationCenter.AskPermissionAsync().ConfigureAwait(false);

                if (allowed == false)
                {
                    return;
                }

                var userInfoDictionary = new NSMutableDictionary();

                if (string.IsNullOrWhiteSpace(notificationRequest.ReturningData) == false)
                {
                    using var returningData = new NSString(notificationRequest.ReturningData);
                    userInfoDictionary.SetValueForKey(
                        string.IsNullOrWhiteSpace(notificationRequest.ReturningData)
                            ? NSString.Empty
                            : returningData, NotificationCenter.ExtraReturnDataIos);
                }

                using var receivedData = new NSString(notificationRequest.iOS.HideForegroundAlert.ToString());
                userInfoDictionary.SetValueForKey(receivedData, NotificationCenter.ExtraNotificationReceivedIos);

                using var soundData = new NSString(notificationRequest.iOS.PlayForegroundSound.ToString());
                userInfoDictionary.SetValueForKey(soundData, NotificationCenter.ExtraSoundInForegroundIos);

                using var content = new UNMutableNotificationContent
                      {
                          Title    = notificationRequest.Title,
                          Body     = notificationRequest.Description,
                          Badge    = notificationRequest.BadgeNumber,
                          UserInfo = userInfoDictionary,
                          Sound    = UNNotificationSound.Default
                      };
                if (string.IsNullOrWhiteSpace(notificationRequest.Sound) == false)
                {
                    content.Sound = UNNotificationSound.GetSound(notificationRequest.Sound);
                }

                var repeats = notificationRequest.Repeats != NotificationRepeat.No;

                if (repeats && notificationRequest.Repeats == NotificationRepeat.TimeInterval &&
                    notificationRequest.NotifyRepeatInterval.HasValue)
                {
                    TimeSpan interval = notificationRequest.NotifyRepeatInterval.Value;

                    trigger = UNTimeIntervalNotificationTrigger.CreateTrigger(interval.TotalSeconds, true);
                }
                else
                {
                    using var notifyTime = GetNsDateComponentsFromDateTime(notificationRequest);
                    trigger = UNCalendarNotificationTrigger.CreateTrigger(notifyTime, repeats);
                }

                var notificationId =
                    notificationRequest.NotificationId.ToString(CultureInfo.CurrentCulture);

                var request = UNNotificationRequest.FromIdentifier(notificationId, content, trigger);

                await UNUserNotificationCenter.Current.AddNotificationRequestAsync(request)
                .ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                trigger?.Dispose();
            }
        }
示例#50
0
 public DatabaseStatsSender(DocumentDatabase database, NotificationCenter notificationCenter)
     : base(database.Name, database.DatabaseShutdown)
 {
     _database           = database;
     _notificationCenter = notificationCenter;
 }
 void NotificationCenterSetToNull()
 {
     instance = null;
 }
示例#52
0
 // Use this for initialization
 void Start()
 {
     NotificationCenter.DefaultCenter().AddObserver(this, "SumarPunto");           //Se recibe lo del metodo
     NotificationCenter.DefaultCenter().AddObserver(this, "Muere");
     ActualizarPuntos();
 }
示例#53
0
 // Use this for initialization
 void Start()
 {
     NotificationCenter.DefaultCenter().AddObserver(this, "PersonajeHaMuerto");
     audioo = GetComponent <AudioSource>();
 }
示例#54
0
        private static void NotifyUIUnload()
        {
            DictionaryEx dic = new DictionaryEx();

            NotificationCenter.DefaultCenter().PostNotification(tmMarcos.kOnUiUnLoad, dic);
        }
示例#55
0
 // Use this for initialization
 void Awake()
 {
     Timer.clearTimers();
     NotificationCenter.resetInstance();
 }
示例#56
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void InitPage()
        {
            this.tabPage      = new TabPage();
            this.tabPage.Text = "untitled";
            this.tabPage.Name = "untitled";
            if (this.name != null)
            {
                this.tabPage.Text = this.name;
                this.tabPage.Name = this.name;
                if (this.isTemplate)
                {
                    this.tabPage.Text = "(T)" + this.name;
                    this.tabPage.Name = "(T)" + this.name;
                }
            }

            //
            //treeView
            //
            this.treeView = new TreeView();
            //this.treeView.BackColor = Color.Yellow;
            this.treeView.AllowDrop        = true;
            this.treeView.Cursor           = System.Windows.Forms.Cursors.Default;
            this.treeView.Dock             = System.Windows.Forms.DockStyle.Fill;
            this.treeView.ItemHeight       = 15;
            this.treeView.Location         = new System.Drawing.Point(0, 0);
            this.treeView.Name             = "treeView";
            this.treeView.RightToLeft      = System.Windows.Forms.RightToLeft.No;
            this.treeView.TabIndex         = 0;
            this.treeView.ShowNodeToolTips = true;
            this.treeView.DragDrop        += new System.Windows.Forms.DragEventHandler(this.treeView_DragDrop);
            this.treeView.DragEnter       += new System.Windows.Forms.DragEventHandler(this.treeView_DragEnter);
            this.treeView.ItemDrag        += new System.Windows.Forms.ItemDragEventHandler(this.treeView_ItemDrag);
            this.treeView.MouseDown       += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseDown);
            this.tabPage.Controls.Add(this.treeView);

            //
            //nodeContextMenuStrip
            //
            this.components              = new System.ComponentModel.Container();
            this.nodeContextMenuStrip    = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.lookNToolStripMenuItem  = new System.Windows.Forms.ToolStripMenuItem();
            this.lookPToolStripMenuItem  = new System.Windows.Forms.ToolStripMenuItem();
            this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.nodeContextMenuStrip.SuspendLayout();
            //this.SuspendLayout();
            //
            // nodeContextMenuStrip
            //
            this.nodeContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.lookNToolStripMenuItem,
                this.lookPToolStripMenuItem,
                this.removeToolStripMenuItem
            });
            this.nodeContextMenuStrip.Name = "nodeContextMenuStrip";
            this.nodeContextMenuStrip.Size = new System.Drawing.Size(173, 92);
            this.nodeContextMenuStrip.ResumeLayout(false);
            //
            // lookNToolStripMenuItem
            //
            this.lookNToolStripMenuItem.Name   = "lookNToolStripMenuItem";
            this.lookNToolStripMenuItem.Size   = new System.Drawing.Size(172, 22);
            this.lookNToolStripMenuItem.Text   = "查看节点";
            this.lookNToolStripMenuItem.Click += new System.EventHandler(this.lookNToolStripMenuItem_Click);
            //
            // lookPToolStripMenuItem
            //
            this.lookPToolStripMenuItem.Name   = "lookPToolStripMenuItem";
            this.lookPToolStripMenuItem.Size   = new System.Drawing.Size(172, 22);
            this.lookPToolStripMenuItem.Text   = "查看条件";
            this.lookPToolStripMenuItem.Click += new System.EventHandler(this.lookPToolStripMenuItem_Click);
            //
            // removeToolStripMenuItem
            //
            this.removeToolStripMenuItem.Name   = "removeToolStripMenuItem";
            this.removeToolStripMenuItem.Size   = new System.Drawing.Size(172, 22);
            this.removeToolStripMenuItem.Text   = "从父亲节点中移除";
            this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);

            //注册通知
            NotificationCenter.DefaultCenter().addObserver(this, "NodeUpdate", 1);         //节点更新
            NotificationCenter.DefaultCenter().addObserver(this, "PreconditionUpdate", 1); //条件更新
            NotificationCenter.DefaultCenter().addObserver(this, "TreeUpdate", 1);         //模板更新
            //创建备忘录管理器
            this.treeCaretaker = new TreeCaretaker();

            //页面显示
            if (this.treeHandler != null && this.treeHandler.Tree != null && this.treeHandler.Tree.Root != null)
            {
                this.AddMemento();
                this.BandIngTreeView(null, null);
            }
        }
示例#57
0
    void OnMaxEnergy(NotificationCenter.Notification n)
    {
        if (n.sender == tower)
        {
            //loaded = true;

            tower.energy = 0;

            //shooterUI.ExpandUI();

            special.Load();

        }
    }
示例#58
0
 void EndRefresh()
 {
     NotificationCenter.PostNotification(Constants.OnUpdateFeedDone);
     pullAnchorTitle.text = pullAnchorDefaultText;
     refreshFinishedHandler();
 }
示例#59
0
 // Update is called once per frame
 void Update()
 {
     NotificationCenter.DefaultCenter().AddObserver(this, "SesionScore");
 }
示例#60
0
 void set_stage_id_to(NotificationCenter.Notification notification)
 {
     StageIDValue.text = string.Format ("{0:0}", (string)notification.data ["value"]);
 }