Ejemplo n.º 1
0
        private void OpenFreindAlert(object freindId, object battleType, object friendName, object friendPortrait)
        {
            long       id       = ( long )freindId;
            BattleType type     = ( BattleType )battleType;
            string     name     = friendName.ToString();
            string     portrait = friendPortrait.ToString();

            if (friendInvationAlertUI == null)
            {
                //show FriendInvationAlert UI ,post MessageType: OpenFriendInvationAlert
                GameResourceLoadManager.GetInstance().LoadAssetAsync("FriendInvationAlertUI", delegate(GameObject data)
                {
                    GameObject obj        = Instantiate(data) as GameObject;
                    friendInvationAlertUI = obj.AddComponent <FriendInvationAlertView>();
                    ChangeUIViewDepthBySetParent(friendInvationAlertUI.gameObject.transform, UIMenuDepth.Alert);

                    obj.transform.localPosition = Vector3.zero;
                    obj.transform.localScale    = Vector3.one;

                    RectTransform rectTrans = obj.GetComponent <RectTransform>();
                    rectTrans.sizeDelta     = Vector2.zero;

                    friendInvationAlertUI.OnEnterAlert(id, type, name, portrait);
                });
            }
            else
            {
                friendInvationAlertUI.gameObject.SetActive(true);
                friendInvationAlertUI.OnEnterAlert(id, type, name, portrait);
            }
        }
        public FriendInvationAlertController( FriendInvationAlertView v )
        {
            view = v;

            //MessageDispatcher.AddObserver( OpenFreindAlert, Constants.MessageType.OpenFriendInvationAlert );
        }