Beispiel #1
0
 public void RefreshPlayerHeadIcon(string orderIconStr)
 {
     GameResourceLoadManager.GetInstance().LoadAtlasSprite(orderIconStr, delegate(string name, AtlasSprite atlasSprite, System.Object param)
     {
         orderHead.SetSprite(atlasSprite);
     }, true);
 }
Beispiel #2
0
        public void RefreshInstituteItem()
        {
            instituteSkillCount = controller.GetInstituteSkillCount();

            GameResourceLoadManager.GetInstance().LoadResource(INSTITUTE_SKILL_ITEM_PATH, OnLoadInstituteSkillItem, true);
            GameResourceLoadManager.GetInstance().LoadResource(INSTITUTE_SKILL_DECK_ITEM_PATH, OnLoadSkillDecklItem, true);
        }
Beispiel #3
0
        private void OpenNewbieGuide(object index, object lastIndex)
        {
            if (newbieGuideView == null)
            {
                GameResourceLoadManager.GetInstance().LoadAssetAsync("NewbieUI", delegate(GameObject data)
                {
                    GameObject obj  = Instantiate(data) as GameObject;
                    newbieGuideView = obj.AddComponent <NewbieGuideView>();
                    ChangeUIViewDepthBySetParent(newbieGuideView.gameObject.transform, UIMenuDepth.LayerNewbie);

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

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

                    MessageDispatcher.PostMessage(MessageType.InitNewbieGuideSucceed);

                    newbieGuideView.Open(index, lastIndex);
                });
            }
            else
            {
                newbieGuideView.gameObject.SetActive(true);
                newbieGuideView.Open(index, lastIndex);
            }
        }
Beispiel #4
0
 public void RefreshItem()
 {
     GameResourceLoadManager.GetInstance().LoadAtlasSprite(unitIconImage, delegate(string name, AtlasSprite atlasSprite, System.Object param)
     {
         armyImage.SetSprite(atlasSprite);
     }, true);
 }
Beispiel #5
0
        public override void OnEnter()
        {
            base.OnEnter();

            this.currentUnitIdList = new List <int>(currentUnits.Keys);
            SetInfoActive(isShowInfoText);

            for (int i = 0; i < currentUnitIdList.Count; i++)
            {
                if (currentUnitIdList[i] == unitId)
                {
                    currentIndex = i;
                    break;
                }
            }

            unitBuyPanel.gameObject.SetActive(false);
            backgroundStoryPanel.gameObject.SetActive(false);
            unitAttackInfoPanel.gameObject.SetActive(false);

            if (loadManager == null)
            {
                loadManager = GameResourceLoadManager.GetInstance();
            }

            GameObject go = DataManager.GetInstance().GetMainMenuCacheObj <GameObject>("UnitModelParent");

            goUnitParent = GameObject.Instantiate(go);
            unitParent   = goUnitParent.transform.Find("node").transform;
            controller.PostShowMainBackground(false);
            RefreshView();
        }
 public void RefreshPlayerHeadIcon()
 {
     GameResourceLoadManager.GetInstance().LoadAtlasSprite(controller.GetPlayerHeadIcon(), delegate(string name, AtlasSprite atlasSprite, System.Object param)
     {
         playerImage.SetSprite(atlasSprite);
     }, true);
 }
Beispiel #7
0
        //Default minimap icon element pool,If need more chache can modify numbers.
        private void InitMiniMapElement(BattleType type)
        {
            resourceLoad = GameResourceLoadManager.GetInstance();

            if (type == BattleType.BattleP2vsP2)
            {
                FillSoldierElementIconPool(32);
                FillTowerElementIconPool(20);
                FillInstituteElementIconPool(4);
                FillEffectItemPool(8);
                FillRuneElementIconPool(2);
            }
            else if (type == BattleType.BattleP1vsP1 || type == BattleType.Tranining || type == BattleType.Tutorial)
            {
                FillSoldierElementIconPool(16);
                FillTowerElementIconPool(10);
                FillInstituteElementIconPool(2);
                FillEffectItemPool(4);
                FillRuneElementIconPool(2);
            }
            else if (type == BattleType.Survival)
            {
                FillSoldierElementIconPool(20);
                FillTowerElementIconPool(5);
                FillInstituteElementIconPool(1);
                FillEffectItemPool(4);
                FillRuneElementIconPool(2);
            }
            else
            {
                DebugUtils.LogError(DebugUtils.Type.MiniMap, string.Format("Can't find this BattleType : {0}", type));
            }
        }
Beispiel #8
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);
            }
        }
Beispiel #9
0
        public void PlayEffect(int effectResId, string bindpoint)
        {
            if (effectResId <= 0 || string.IsNullOrEmpty(bindpoint))
            {
                DebugUtils.LogWarning(DebugUtils.Type.AI_Skill, "Summon Render : " + metaId + " play a effect failed! effectResId:" + effectResId + " bindPoint:" + bindpoint);
                return;
            }

            GameObject effect;

            if (effects.ContainsKey(effectResId))
            {
                effect = effects[effectResId];
            }
            else
            {
                effect = GameObject.Instantiate(GameResourceLoadManager.GetInstance().LoadAsset <GameObject>(effectResId));
                effects.Add(effectResId, effect);
            }

            effect.transform.parent        = GetBindPoint(bindpoint);
            effect.transform.localPosition = Vector3.zero;
            effect.transform.localRotation = Quaternion.identity;
            effect.gameObject.SetActive(false);
            effect.gameObject.SetActive(true);
        }
Beispiel #10
0
 private void SetIconImage(Image image, int iconId)
 {
     GameResourceLoadManager.GetInstance().LoadAtlasSprite(iconId, delegate(string name, AtlasSprite atlasSprite, System.Object param)
     {
         image.SetSprite(atlasSprite);
     }, true);
 }
Beispiel #11
0
        private void OpenAlertWindow(object confirmEvent, object type, object contentText, object titleText)
        {
            if (alertUI == null)
            {
                //show Alert UI ,post MessageType: OpenAlertWindow
                GameResourceLoadManager.GetInstance().LoadAssetAsync <GameObject>("AlertUI", delegate(GameObject go)
                {
                    GameObject obj = Instantiate(go) as GameObject;
                    alertUI        = obj.AddComponent <AlertView>();
                    ChangeUIViewDepthBySetParent(alertUI.gameObject.transform, UIMenuDepth.Alert);

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

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

                    alertUI.Open(confirmEvent, type, contentText, titleText);
                });
            }
            else
            {
                alertUI.gameObject.SetActive(true);
                alertUI.Open(confirmEvent, type, contentText, titleText);
            }
        }
Beispiel #12
0
        protected BattleEffectHandler LoadEffect(int effectResId)
        {
            if (effectResId <= 0)
            {
                DebugUtils.LogWarning(DebugUtils.Type.AI_Skill, "Soldier Render : " + metaId + " play a effect failed! effectResId:" + effectResId);
                return(null);
            }

            BattleEffectHandler effectHandler;

            if (effectHandlers.ContainsKey(effectResId))
            {
                effectHandler = effectHandlers[effectResId];
            }
            else
            {
                GameObject go = GameResourceLoadManager.GetInstance().LoadAsset <GameObject>(effectResId);
                DebugUtils.Assert(go != null, string.Format("The Resource you want to instantiate is null, resourceId = {0}", effectResId));

                effectHandler = GameObject.Instantiate(go).AddComponent <BattleEffectHandler>();
                effectHandlers.Add(effectResId, effectHandler);
            }

            return(effectHandler);
        }
Beispiel #13
0
        public void RefreshBagItem()
        {
            bagItemCount = controller.GetPlayerBagListCount(currentBagType);
            SetItemState(bagItemCount > 0);

            GameResourceLoadManager.GetInstance().LoadResource("PlayerBagItem", OnLoadBagItem, true);
        }
Beispiel #14
0
        //Drag deployment logic locked.Dwayne 2017.9

        /*
         * public void ShowDeployModelEffect( Transform trans )
         * {
         * Animator a;
         * if ( deployModelEffectPool.Count > 0 )
         * {
         * a = deployModelEffectPool[0];
         * deployModelEffectPool.RemoveAt( 0 );
         * a.gameObject.SetActive( true );
         * }
         * else
         * {
         * GameObject g = GameResourceLoadManager.GetInstance().LoadAsset<GameObject>( "deployment_pod_v2" );
         * a = GameObject.Instantiate( g ).GetComponent<Animator>();
         * a.transform.parent = transform;
         * }
         *
         * a.transform.position = trans.position;
         *
         * StartCoroutine( WaitSeconds( () =>
         * {
         * a.transform.Find( "Avatar_Character_Drop_Pod/Persistant_Effects" ).gameObject.SetActive( true );
         * a.transform.Find( "Avatar_Character_Drop_Pod/Destroy_Effects" ).gameObject.SetActive( true );
         * a.SetTrigger( "Destroy" );
         *
         * trans.gameObject.SetActive( true );
         *
         * StartCoroutine( WaitSeconds( () =>
         * {
         *  a.gameObject.SetActive( false );
         *  deployModelEffectPool.Add( a );
         * }, 5 ) );
         *
         * }, 1.5f ) );
         * }*/

        //This is new deployModelEffect.
        public void ShowNewDeployModelEffect(Vector3 pos)
        {
            GameObject effect;

            if (newDeployModelEffectPool.Count > 0)
            {
                effect = newDeployModelEffectPool[0];
                newDeployModelEffectPool.RemoveAt(0);
                effect.SetActive(true);
            }
            else
            {
                GameObject go = GameResourceLoadManager.GetInstance().LoadAsset <GameObject>(30401);
                effect = GameObject.Instantiate(go);
            }

            effect.transform.position = pos;

            //transform.gameObject.SetActive( true );

            StartCoroutine(WaitSeconds(() =>
            {
                effect.gameObject.SetActive(false);
                newDeployModelEffectPool.Add(effect);
            }, 1));
        }
Beispiel #15
0
        private void Initialize()
        {
            isInited = true;

            playerInfoButton = transform.Find("PlayerInfoButton").GetComponent <Button>();
            playerInfoButton.onClick.AddListener(OnPlayerInfoButtonClicked);

            chatButton = transform.Find("ButtonPanel/ChatButton").GetComponent <Button>();
            chatButton.onClick.AddListener(OnChatButtonClicked);

            giveMoneyButton = transform.Find("ButtonPanel/MoneyButton").GetComponent <Button>();
            giveMoneyButton.onClick.AddListener(OnGiveMoneyButtonClicked);

            giftButton = transform.Find("ButtonPanel/GiftButton").GetComponent <Button>();
            giftButton.onClick.AddListener(OnGiftButtonClicked);

            deleteFriendButton = transform.Find("ButtonPanel/DeleteButton").GetComponent <Button>();
            deleteFriendButton.onClick.AddListener(OnDeleteFriendButtonClicked);

            invitePlayerInGuildButton = transform.Find("BlockListButton").GetComponent <Button>();
            invitePlayerInGuildButton.onClick.AddListener(OnBlockListButtonClickEvent);

            playerVipIcon  = transform.Find("VipIcon").GetComponent <Image>();
            playerRankIcon = transform.Find("RankIcon").GetComponent <Image>();

            playerNameText          = transform.Find("PlayerNameText").GetComponent <Text>();
            playerLevelText         = transform.Find("PlayerLevel").GetComponent <Text>();
            playerNetworkStatusText = transform.Find("NetworkStatusText").GetComponent <Text>();

            gameResourceLoadManager = GameResourceLoadManager.GetInstance();
        }
Beispiel #16
0
        public void RefreshBagView(Data.BagType type, int index)
        {
            itemNameText.text      = controller.GetPlayerBagItemName(type, index);
            itemCountText.text     = "<color=#d5d5d5>拥有:</color> " + controller.GetPlayerBagItemCount(type, index);
            itemIntroduceText.text = controller.GetPlayerBagItemDescribe(type, index);
            itemPriceText.text     = controller.GetPlayerBagItemPrice(type, index).ToString();

            int icon = controller.GetPlayerBagItemIcon(type, index);

            if (icon != 0)
            {
                GameResourceLoadManager.GetInstance().LoadAtlasSprite(icon, delegate(string name, AtlasSprite atlasSprite, System.Object param) {
                    itemIcon.SetSprite(atlasSprite);
                }, true);
            }

            bool canShell = controller.GetPlayerBagItemIsShell(type, index) == 1;

            sellButton.interactable = canShell;
            itemSellText.gameObject.SetActive(canShell);
            goldImage.gameObject.SetActive(canShell);
            itemNotSellText.gameObject.SetActive(!canShell);
            itemPriceText.gameObject.SetActive(canShell);

            bool notUse = controller.GetPlayerBagItemUseType(type, index) == 0;

            useButton.gameObject.SetActive(!notUse);
            useText.gameObject.SetActive(!notUse);

            bool isRune = controller.IsRune(type, index);

            itemFrameImage1.gameObject.SetActive(!isRune);
            itemFrameImage2.gameObject.SetActive(isRune);
        }
Beispiel #17
0
        private void OpenPopUp()
        {
            if (currentSelectType == 1)  //Use
            {
                titleText_p.text = "使用";
            }
            else//Sell
            {
                titleText_p.text = "出售";
            }

            nameText_p.text     = controller.GetPlayerBagItemName(currentBagType, currentItemIndex);
            countText_p.text    = "<color=#d5d5d5>拥有:</color> " + controller.GetPlayerBagItemCount(currentBagType, currentItemIndex);
            describeText_p.text = controller.GetPlayerBagItemDescribe(currentBagType, currentItemIndex);
            propText_p.text     = controller.GetItemProp(currentBagType, currentItemIndex);

            bool isRune = controller.IsRune(currentBagType, currentItemIndex);

            frameImage1_p.gameObject.SetActive(!isRune);
            frameImage2_p.gameObject.SetActive(isRune);

            int icon = controller.GetPlayerBagItemIcon(currentBagType, currentItemIndex);

            if (icon != 0)
            {
                GameResourceLoadManager.GetInstance().LoadAtlasSprite(icon, delegate(string name, AtlasSprite atlasSprite, System.Object param) {
                    iconImage_p.SetSprite(atlasSprite);
                }, true);
            }

            popUpPanel.gameObject.SetActive(true);
        }
Beispiel #18
0
        private void OpenLoudspeaker()
        {
            if (loudspeakerView == null)
            {
                //show LoudspeakerUI
                GameResourceLoadManager.GetInstance().LoadAssetAsync("LoudspeakerUI", delegate(GameObject data)
                {
                    GameObject obj  = Instantiate(data) as GameObject;
                    loudspeakerView = obj.AddComponent <LoudspeakerView>();
                    ChangeUIViewDepthBySetParent(loudspeakerView.gameObject.transform, UIMenuDepth.Loudspeaker);

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

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

                    loudspeakerView.ShowLoudspeakerPanel();
                });
            }
            else
            {
                loudspeakerView.gameObject.SetActive(true);
                loudspeakerView.ShowLoudspeakerPanel();
            }
        }
        private void InitMianUIBattleResultItem()
        {
            victoryCount = controller.GetMainUIBattleWinDataList().Count;
            failCount    = controller.GetMainUIBattleLoseDataList().Count;

            GameResourceLoadManager.GetInstance().LoadResource(BATTLE_RESULT__ITEM_PATH, OnLoadMianUIBattleVictoryItem, true);
            GameResourceLoadManager.GetInstance().LoadResource(BATTLE_RESULT__ITEM_PATH, OnLoadMianUIBattleLoseItem, true);
        }
Beispiel #20
0
        public void RefreshArmyItem()
        {
            _armyCard_itemCount = controller.GetUnitsCount();

            GameResourceLoadManager.GetInstance().LoadResource(ARMY_CARD_ITEM_PATH, OnLoadArmyCardItem, true);

            GameResourceLoadManager.GetInstance().LoadResource(COMBATDECK_CARD_ITEM_PATH, OnLoadCombatDeckCardItem, true);
        }
        public void InitBattleResultItem()
        {
            victoryCount = controller.GetVictoryCount();
            failCount    = controller.GetFailCount();

            GameResourceLoadManager.GetInstance().LoadResource(BATTLE_RESULT__ITEM_PATH, OnLoadVictoryItem, true);
            GameResourceLoadManager.GetInstance().LoadResource(BATTLE_RESULT__ITEM_PATH, OnLoadFailItem, true);
        }
        public void RefreshPanel()
        {
            GameResourceLoadManager.GetInstance().LoadAtlasSprite(icon, delegate(string name, AtlasSprite atlasSprite, System.Object param)
            {
                attackImage.SetSprite(atlasSprite);
            }, true);

            describeText.text = descripe;
        }
Beispiel #23
0
 public void RefreshItem()
 {
     itemTogger.group = group;
     GameResourceLoadManager.GetInstance().LoadAtlasSprite(icon, delegate(string name, AtlasSprite atlasSprite, System.Object param)
     {
         itemImage.SetSprite(atlasSprite);
     }, true);
     itemNumberText.text = number.ToString();
 }
Beispiel #24
0
 public void  ShowSlotImage(string path, Image image)
 {
     GameResourceLoadManager.GetInstance().LoadAtlasSprite(path,
                                                           delegate(string name, AtlasSprite atlasSprite, System.Object param)
     {
         slotImage.SetSprite(atlasSprite);
     },
                                                           true);
 }
Beispiel #25
0
 private AudioClip GetAudioClip(int id)
 {
     if (!audioClipDict.ContainsKey(id))
     {
         AudioClip ac = GameResourceLoadManager.GetInstance().LoadAsset <AudioClip>(id);
         audioClipDict.Add(id, ac);
     }
     return(audioClipDict[id]);
 }
Beispiel #26
0
        public void RefreshGoodsItem()
        {
            SetButton(false);
            SetDescriptionUI(false);
            SetGoodsCountUI(false);
            //goodsCount = controller.GetGoodsCount( currentType, currentGoodsType );

            GameResourceLoadManager.GetInstance().LoadResource("Goods_Item", OnLoadGoodsItem, true);
        }
Beispiel #27
0
 public void RefreshMatchUnitItem()
 {
     if (icon != 0)
     {
         GameResourceLoadManager.GetInstance().LoadAtlasSprite(icon, delegate(string name, AtlasSprite atlasSprite, System.Object param) {
             itemImage.SetSprite(atlasSprite);
         }, true);
     }
 }
 public void Init(RuneInfo info)
 {
     this.name.text = String.Format("{0}级  {1}", info.level, info.nane);
     GameResourceLoadManager.GetInstance().LoadAtlasSprite(info.iconid, delegate(string name, AtlasSprite atlasSprite, System.Object param)
     {
         this.runeIcon.SetSprite(atlasSprite);
     }, true);
     this.attribute.text = info.itemattribute;
 }
Beispiel #29
0
        private IEnumerator GenerateBanner(NoticeType resType, BattleResultData resInfo)
        {
            yield return(new WaitForSeconds(3.0f));

            GameObject banner;

            switch (resType)
            {
            case NoticeType.BattleResultBlueWin:
            {
                if (DataManager.GetInstance().GetMatchSide() == MatchSide.Red)
                {
                    banner = Instantiate(GameResourceLoadManager.GetInstance().LoadAsset <GameObject>("BannerDefeat"));

                    SoundManager.Instance.PlayMusic(GameConstants.SOUND_DEFEAT_ID, false);
                }
                else
                {
                    banner = Instantiate(GameResourceLoadManager.GetInstance().LoadAsset <GameObject>("BannerVictory"));

                    SoundManager.Instance.PlayMusic(GameConstants.SOUND_VICTORY_ID, false);
                }
                break;
            }

            case NoticeType.BattleResultRedWin:
            {
                if (DataManager.GetInstance().GetMatchSide() == MatchSide.Red)
                {
                    banner = Instantiate(GameResourceLoadManager.GetInstance().LoadAsset <GameObject>("BannerVictory"));

                    SoundManager.Instance.PlayMusic(GameConstants.SOUND_VICTORY_ID, false);
                }
                else
                {
                    banner = Instantiate(GameResourceLoadManager.GetInstance().LoadAsset <GameObject>("BannerDefeat"));

                    SoundManager.Instance.PlayMusic(GameConstants.SOUND_DEFEAT_ID, false);
                }
                break;
            }

            default:
            {
                banner = Instantiate(Resources.Load("Prefabs/UI/BattleScreenItem/banners/banner_draw") as GameObject);

                SoundManager.Instance.PlayMusic(GameConstants.SOUND_VICTORY_ID, false);
                break;
            }
            }

            //banner.transform.Find( "Image" ).gameObject.SetActive( false );
            banner.transform.SetParent(transform.parent, false);

            StartCoroutine(EnableBattleResult(resType, resInfo, banner));
        }
Beispiel #30
0
 public void RefreshItem()
 {
     onClickEvent              = null;
     attributeText.text        = attribute;
     runeNameAndLeverText.text = string.Format("{0}" + "级" + "  {1}", level, runeName);
     GameResourceLoadManager.GetInstance().LoadAtlasSprite(icon, delegate(string name, AtlasSprite atlasSprite, System.Object param)
     {
         runeIcon.SetSprite(atlasSprite);
     }, true);
 }