/// <summary>
 ///
 /// </summary>
 /// <param name="type">Type. 1 : bottom, 2: top</param>
 public void WillToMainView(ActivityItemType type, int Pos)
 {
     if (Pos == 1)
     {
         WXLAcitvityFactory.CreatActivity(type, localObj);
     }
     else
     {
         WXLAcitvityFactory.CreatActivity(type, (object)DBUIController.mDBUIInstance._TopRoot);
     }
 }
 public static UIActMonsterComeController CreateMonsterPanel(ActivityItemType type, GameObject tObj)
 {
     UnityEngine.Object obj = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UIMonsterComePanel);
     if (obj != null)
     {
         GameObject go = Instantiate(obj) as GameObject;
         UIActMonsterComeController fc = go.GetComponent <UIActMonsterComeController> ();
         Transform goTrans             = go.transform;
         go.transform.parent        = DBUIController.mDBUIInstance._bottomRoot.transform;
         go.transform.localPosition = Vector3.zero;
         goTrans.localScale         = Vector3.one;
         return(fc);
     }
     return(null);
 }
Example #3
0
//
//	public WXLActivityFestivalController(object obj){
//			objParent = (GameObject)obj;
//			festivalCtrl = CreateFestivalPanel (ActivityItemType.festivalItem,objParent);
//
//	}

    public static WXLActivityFestivalController CreateFestivalPanel(ActivityItemType type, GameObject tObj)
    {
        UnityEngine.Object obj = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UIFestivalPanel);
        if (obj != null)
        {
            GameObject go = Instantiate(obj) as GameObject;
            WXLActivityFestivalController fc = go.GetComponent <WXLActivityFestivalController>();
            Transform goTrans = go.transform;
            go.transform.parent        = tObj.transform;
            go.transform.localPosition = Vector3.zero;
            goTrans.localScale         = Vector3.one;
            return(fc);
        }
        return(null);
    }
 public static UIDateSignController CreateUIdateSignPanel(ActivityItemType type, GameObject tObj)
 {
     UnityEngine.Object obj = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UISignPanel);
     if (obj != null)
     {
         GameObject           go      = Instantiate(obj) as GameObject;
         UIDateSignController fc      = go.GetComponent <UIDateSignController> ();
         Transform            goTrans = go.transform;
         go.transform.parent        = tObj.transform;
         go.transform.localPosition = Vector3.zero;
         goTrans.localScale         = Vector3.one;
         RED.TweenShowDialog(go);
         return(fc);
     }
     return(null);
 }
    public static UILevelRewardController CreateUILevelRewardPanel(ActivityItemType type, GameObject tObj, System.Action callback = null)
    {
        UnityEngine.Object obj = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UILevelRewardPanel);
        if (obj != null)
        {
            GameObject go = Instantiate(obj) as GameObject;
            UILevelRewardController fc = go.GetComponent <UILevelRewardController>();
            Transform goTrans          = go.transform;
            go.transform.parent        = tObj.transform;
            go.transform.localPosition = Vector3.zero;
            goTrans.localScale         = Vector3.one;
            if (fc != null)
            {
                fc.CallBack = callback;
            }

            return(fc);
        }
        return(null);
    }
		internal ActivityItem(XmlNode itemNode)
		{
			XmlNode node;

			node = itemNode.Attributes.GetNamedItem("type");

			if( node == null )
				_activityType = ActivityItemType.Unknown;
			else if( node.Value == "photoset" )
				_activityType = ActivityItemType.Photoset;
			else if( node.Value == "photo" )
				_activityType = ActivityItemType.Photo;
			else
				_activityType = ActivityItemType.Unknown;

			node = itemNode.Attributes.GetNamedItem("owner");
			if( node != null ) _ownerId = node.Value;

			node = itemNode.Attributes.GetNamedItem("id");
			if( node != null ) _id = node.Value;

			node = itemNode.Attributes.GetNamedItem("secret");
			if( node != null ) _secret = node.Value;

			node = itemNode.Attributes.GetNamedItem("server");
			if( node != null ) _server = node.Value;

			node = itemNode.Attributes.GetNamedItem("farm");
			if( node != null ) _farm = node.Value;

			node = itemNode.Attributes.GetNamedItem("commentsnew");
			if( node != null ) _commentsNew = Convert.ToInt32(node.Value);

			node = itemNode.Attributes.GetNamedItem("commentsold");
			if( node != null ) _commentsOld = Convert.ToInt32(node.Value);

			node = itemNode.Attributes.GetNamedItem("comments");
			if( node != null ) _comments = Convert.ToInt32(node.Value);

			node = itemNode.Attributes.GetNamedItem("more");
			if( node != null ) _more = Convert.ToInt32(node.Value);

			node = itemNode.Attributes.GetNamedItem("views");
			if( node != null ) _views = Convert.ToInt32(node.Value);

			node = itemNode.SelectSingleNode("title");
			if( node != null ) _title = node.InnerText;

			XmlNodeList list = itemNode.SelectNodes("activity/event");

			_events = new ActivityEvent[list.Count];

			for(int i = 0; i < _events.Length; i++)
			{
				node = list[i];
				_events[i] = new ActivityEvent(node);
			}

			// Photoset specific
			// Photos, PrimaryPhotoId

			node = itemNode.Attributes.GetNamedItem("photos");
			if( node != null ) _photos = Convert.ToInt32(node.Value);

			node = itemNode.Attributes.GetNamedItem("primary");
			if( node != null ) _primaryId = node.Value;

			// Photo specific
			// NodesNew and NodesOld, Favourites

			node = itemNode.Attributes.GetNamedItem("notesnew");
			if( node != null ) _notesNew = Convert.ToInt32(node.Value);

			node = itemNode.Attributes.GetNamedItem("notesold");
			if( node != null ) _notesOld = Convert.ToInt32(node.Value);

			node = itemNode.Attributes.GetNamedItem("notes");
			if( node != null ) _notes = Convert.ToInt32(node.Value);

			node = itemNode.Attributes.GetNamedItem("faves");
			if( node != null ) _favs = Convert.ToInt32(node.Value);
		}
    public static void CreatActivity(ActivityItemType type, object objPos, System.Action callback = null)
    {
        //	AbsActivity AbsA= null;
        switch (type)
        {
        case ActivityItemType.festivalItem:
            if (_ActFestivalCtrl == null)
            {
                _ActFestivalCtrl = WXLActivityFestivalController.CreateFestivalPanel(ActivityItemType.festivalItem, (GameObject)objPos);
            }
            else
            {
                _ActFestivalCtrl.gameObject.SetActive(true);
            }

            //	ActivityNetController.GetInstance().SendLoginFestival ();
            break;

        case  ActivityItemType.mosterComeItem:
            if (_ActMonsterCtrl == null)
            {
                _ActMonsterCtrl = UIActMonsterComeController.CreateMonsterPanel(ActivityItemType.mosterComeItem, (GameObject)objPos);
            }
            else
            {
                _ActMonsterCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.taobaoItem:
            if (_ActTaoBaoCtrl == null)
            {
                _ActTaoBaoCtrl = UITaoBaoController.CreateTaoBaoPanel(ActivityItemType.taobaoItem, (GameObject)objPos);
            }
            else
            {
                _ActTaoBaoCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.dinnerItem:
            if (_ActDinnerCtrl == null)
            {
                _ActDinnerCtrl = ActDinnerController.CreateDinnerPanel(ActivityItemType.dinnerItem, (GameObject)objPos);
            }
            else
            {
                _ActDinnerCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.qiandaoItem:
            if (_ActDateSignCtrl == null)
            {
                _ActDateSignCtrl = UIDateSignController.CreateUIdateSignPanel(ActivityItemType.qiandaoItem, (GameObject)objPos);
            }
            else
            {
                _ActDateSignCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.levelRewardItem:
            if (_ActLevelRewardCtrl == null)
            {
                _ActLevelRewardCtrl = UILevelRewardController.CreateUILevelRewardPanel(ActivityItemType.levelRewardItem, (GameObject)objPos, callback);
            }
            else
            {
                _ActLevelRewardCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.gonggaoItem:
            AnnounceMrg.GetInstance().SetInfoPanel(true);
            break;

        case ActivityItemType.secretShopItem:
            SecretShopMgr.GetInstance().SetSecretShop(true, 1);
            DBUIController.mDBUIInstance.HiddenFor3D_UI();
            break;

        case ActivityItemType.vipEnter:
            UIDragonMallMgr.GetInstance().SetVipLibao();
            break;

        case ActivityItemType.TreasureBoxItem:
            if (_ActTreasureBoxCtrl == null)
            {
                _ActTreasureBoxCtrl = TreasureBoxController.CreatTreasureBoxCtr();
            }
            else
            {
                _ActTreasureBoxCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.RollGamblePanel:
            RollGambleController.CreatRollGamblePanel();
            break;

        case ActivityItemType.DailyGiftPanel:
            DailyGiftController.CreatDailyGiftController();
            break;

        case ActivityItemType.DragonBank:
            DragonBankController.CreatDragonBankController();
            break;

        default:
            //	AbsA = null;
            break;
        }
    }
Example #8
0
        internal ActivityItem(XmlNode itemNode)
        {
            XmlNode node;

            node = itemNode.Attributes.GetNamedItem("type");

            if (node == null)
            {
                _activityType = ActivityItemType.Unknown;
            }
            else if (node.Value == "photoset")
            {
                _activityType = ActivityItemType.Photoset;
            }
            else if (node.Value == "photo")
            {
                _activityType = ActivityItemType.Photo;
            }
            else
            {
                _activityType = ActivityItemType.Unknown;
            }

            node = itemNode.Attributes.GetNamedItem("owner");
            if (node != null)
            {
                _ownerId = node.Value;
            }

            node = itemNode.Attributes.GetNamedItem("id");
            if (node != null)
            {
                _id = node.Value;
            }

            node = itemNode.Attributes.GetNamedItem("secret");
            if (node != null)
            {
                _secret = node.Value;
            }

            node = itemNode.Attributes.GetNamedItem("server");
            if (node != null)
            {
                _server = node.Value;
            }

            node = itemNode.Attributes.GetNamedItem("farm");
            if (node != null)
            {
                _farm = node.Value;
            }

            node = itemNode.Attributes.GetNamedItem("commentsnew");
            if (node != null)
            {
                _commentsNew = Convert.ToInt32(node.Value);
            }

            node = itemNode.Attributes.GetNamedItem("commentsold");
            if (node != null)
            {
                _commentsOld = Convert.ToInt32(node.Value);
            }

            node = itemNode.Attributes.GetNamedItem("comments");
            if (node != null)
            {
                _comments = Convert.ToInt32(node.Value);
            }

            node = itemNode.Attributes.GetNamedItem("more");
            if (node != null)
            {
                _more = Convert.ToInt32(node.Value);
            }

            node = itemNode.Attributes.GetNamedItem("views");
            if (node != null)
            {
                _views = Convert.ToInt32(node.Value);
            }

            node = itemNode.SelectSingleNode("title");
            if (node != null)
            {
                _title = node.InnerText;
            }

            XmlNodeList list = itemNode.SelectNodes("activity/event");

            _events = new ActivityEvent[list.Count];

            for (int i = 0; i < _events.Length; i++)
            {
                node       = list[i];
                _events[i] = new ActivityEvent(node);
            }

            // Photoset specific
            // Photos, PrimaryPhotoId

            node = itemNode.Attributes.GetNamedItem("photos");
            if (node != null)
            {
                _photos = Convert.ToInt32(node.Value);
            }

            node = itemNode.Attributes.GetNamedItem("primary");
            if (node != null)
            {
                _primaryId = node.Value;
            }

            // Photo specific
            // NodesNew and NodesOld, Favourites

            node = itemNode.Attributes.GetNamedItem("notesnew");
            if (node != null)
            {
                _notesNew = Convert.ToInt32(node.Value);
            }

            node = itemNode.Attributes.GetNamedItem("notesold");
            if (node != null)
            {
                _notesOld = Convert.ToInt32(node.Value);
            }

            node = itemNode.Attributes.GetNamedItem("notes");
            if (node != null)
            {
                _notes = Convert.ToInt32(node.Value);
            }

            node = itemNode.Attributes.GetNamedItem("faves");
            if (node != null)
            {
                _favs = Convert.ToInt32(node.Value);
            }
        }