Exemplo n.º 1
0
    public int getLength()
    {
        FormationSample sample = FormationSampleManager.Instance.getFormationSampleBySid(formationID);

        return(sample.getLength());
    }
Exemplo n.º 2
0
    protected override void begin()
    {
        if (isAwakeformHide)
        {
            if (comeFrom == FROM_LADDERS)
            {
                FPortManager.Instance.getFPort <LaddersGetInfoFPort> ().apply((bo) => {
                    if (bo)
                    {
                        updateView_ladders();
                    }
                });
            }
            MaskWindow.UnlockUI();
            return;
        }
        buttonInfo.combatBg.spriteName = "allCombat";
        switch (comeFrom)
        {
        case FROM_LADDERS:
            buttonInfo.root_ladders.SetActive(true);
            buttonInfo.root_nomal.SetActive(false);
            setNormalButtonVisible(false);
            setLaddersOppButtonVisible(true);
            setLaddersFriendButtonVisible(false);
            break;

        case FROM_LADDERS_FRIEND:
            buttonInfo.root_ladders.SetActive(true);
            buttonInfo.root_nomal.SetActive(false);
            //buttonInfo.label_applyHelpCount.gameObject.SetActive (false);
            setNormalButtonVisible(false);
            setLaddersOppButtonVisible(false);
            setLaddersFriendButtonVisible(true);
            break;

        case FROM_GUILD_AREA:
            guild_area_challenge.gameObject.SetActive(false);
            buttonInfo.root_nomal.SetActive(true);
            buttonInfo.combatBg.gameObject.SetActive(false);
            buttonInfo.combat.gameObject.SetActive(false);
            break;

        case FROM_GUILD_AREA_CHALLENGE:
            guild_area_challenge.gameObject.SetActive(true);
            buttonInfo.root_nomal.SetActive(true);
            buttonInfo.combatBg.gameObject.SetActive(false);
            buttonInfo.combat.gameObject.SetActive(false);
            break;

        default:
            buttonInfo.root_ladders.SetActive(false);
            buttonInfo.root_nomal.SetActive(true);
            setNormalButtonVisible(true);
            setLaddersOppButtonVisible(false);
            setLaddersFriendButtonVisible(false);
            break;
        }

        base.begin();
        if (oppItem != null)
        {
            uid = oppItem.uid;
            FormationSample sample = FormationSampleManager.Instance.getFormationSampleBySid(oppItem.formation);
            buttonInfo.initInfo(oppItem, this);

            if (sample != null)
            {
                loadFormationGB(buttonInfo, sample.getLength(), buttonInfo.gameObject);
            }
            else
            {
                teamType = PVP_TEAM_TYPE;
            }

            CreateFormation(buttonInfo, oppItem);


            if (comeFrom == FROM_LADDERS)
            {
                updateView_ladders();
            }
            else if (comeFrom == FROM_LADDERS_FRIEND)
            {
                udpateView_ladders_friend();
            }
            else if (comeFrom == FROM_GUILD_AREA || comeFrom == FROM_GUILD_AREA_CHALLENGE)
            {
                updateView_guildFight();
            }
            else
            {
                updateView_normal();
            }
        }

        MaskWindow.UnlockUI();
    }