コード例 #1
0
    override public void OnEnter(MatchState lastState)
    {
        GameMatch match = m_match;

        if (match == null || match.mCurScene == null)
        {
            return;
        }

        foreach (Player player in GameSystem.Instance.mClient.mPlayerManager)
        {
            player.m_enableAction   = false;
            player.m_enableMovement = false;

            if (player.m_catchHelper != null)
            {
                player.m_catchHelper.enabled = false;
            }

            player.m_bToCatch = false;
            if (player.m_pickupDetector != null)
            {
                player.m_enablePickupDetector = false;
                Debug.Log("MatchStatePlotBegin:  pickup detector sets to false.");
            }

            //player.m_enbleMovement = false;

            //player.m_StateMachine.SetState(PlayerState.State.eStand, true);

            player.Hide();
        }

        if (plotUI == null)
        {
            plotUI        = GameSystem.Instance.mClient.mUIManager.CreateUI("UIPlayPlot").GetComponent <UIPlayPlot>();
            plotUI.onNext = OnNextDialogClick;
            if (plotUI == null)
            {
                Debug.Log("Error -- can not find UI resource " + "UIPlayPlot");
                return;
            }
        }

        uint sectionID = (uint)(double)(LuaScriptMgr.Instance.GetLuaTable("_G")["CurSectionID"]);

        m_sectionConfig = GameSystem.Instance.CareerConfigData.GetSectionData(sectionID);
        uint firstDialog = 0;

        if (m_eState == State.ePlotBegin)
        {
            firstDialog = m_sectionConfig.plot_begin_id;
        }
        else if (m_eState == State.ePlotEnd)
        {
            firstDialog = m_sectionConfig.plot_end_id;
        }
        if (CareerConfig.plotConfig.ContainsKey(firstDialog) == false)
        {
            if (m_eState == State.ePlotBegin)
            {
                m_stateMachine.SetState(MatchState.State.eShowRule);
            }
            else
            {
                OnEndResult();
            }
            return;
        }
        m_plotConfig   = CareerConfig.plotConfig[firstDialog];
        m_nextDialogID = m_plotConfig[0].dialog_id;
        ShowDialog(m_nextDialogID);

        for (int i = 0; i < match.m_homeTeam.GetMemberCount(); ++i)
        {
            match.m_homeTeam.GetMember(i).m_InfoVisualizer.m_goPlayerInfo.SetActive(false);
        }
        for (int i = 0; i < match.m_awayTeam.GetMemberCount(); ++i)
        {
            match.m_awayTeam.GetMember(i).m_InfoVisualizer.m_goPlayerInfo.SetActive(false);
        }

        if (match.m_uiMatch != null)
        {
            match.m_gameMatchCountStop = true;
            match.m_count24TimeStop    = true;
        }
    }
コード例 #2
0
    protected override void OnFirstStart()
    {
        base.OnFirstStart();

        plot = UIManager.Instance.CreateUI("UIPlayPlot").GetComponent <UIPlayPlot>();
        plot.Hide();
        plot.onNext = OnPlotNext;

        match.HideSignal();
        match.HideTitle();
        match.HideBackButton();

        guideTip = UIManager.Instance.CreateUI("GuideTip_3").AddMissingComponent <GuideTip>();
        guideTip.transform.localPosition = new Vector3(18, -316, 0);
        guideTip.firstButtonVisible      = false;
        guideTip.Hide();


        foreach (UController.Button btn in match.m_uiController.m_btns)
        {
            if (btn.btn != null)
            {
                UIEventListener.Get(btn.btn.gameObject).onPress += OnBtnPress;
            }
        }

        match.onTipClick += OnTipClick;
        ball.onGrab      += OnGrab;
        ball.onCatch     += OnCatch;
        ball.onShoot     += OnShoot;
        ball.onHitGround += OnHitGround;
        match.mCurScene.mBasket.onGoal += OnGoal;

        prefabObjFinish = ResourceLoadManager.Instance.LoadPrefab("Prefab/GUI/MatchGuideObjectiveFinish") as GameObject;
        paneObjective   = UIManager.Instance.CreateUI("MatchGuideObjectivePane");
        UIGrid     gridObj    = paneObjective.transform.FindChild("Grid").GetComponent <UIGrid>();
        GameObject prefabItem = ResourceLoadManager.Instance.LoadPrefab("Prefab/GUI/MatchGuideObjectiveItem") as GameObject;

        PractiseStep step = GameSystem.Instance.PractiseStepConfig.GetFirstStep();

        readyStepID = step.ID;
        while (true)
        {
            if (step.startObjective.Key != 0)
            {
                lastObjID = step.startObjective.Key;
                GameObject item = CommonFunction.InstantiateObject(prefabItem, gridObj.transform);
                item.GetComponentInChildren <UILabel>().text = step.startObjective.Value;
                objectives.Add(step.startObjective.Key, item);
            }
            if (step.next == 0)
            {
                break;
            }
            else
            {
                step = GameSystem.Instance.PractiseStepConfig.GetStep(step.next);
            }
        }
        gridObj.Reposition();
    }