示例#1
0
    private void ReadBlockStromPosConfig()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(name3);

        if (text == null)
        {
            Debug.LogError("LoadConfig Failed:" + name3);
            return;
        }

        if (BlockStormPos.npc_transforms == null)
        {
            BlockStormPos.npc_transforms = new List <IM.Transform>();
        }

        XmlDocument xmlDoc   = CommonFunction.LoadXmlConfig(name3, text);
        XmlNode     root     = xmlDoc.LastChild;
        XmlNodeList npcs     = root.ChildNodes;
        int         npcCount = npcs.Count;

        for (int i = 0; i < npcCount; ++i)
        {
            XmlNode      node      = npcs.Item(i);
            IM.Transform tempTrans = new IM.Transform();
            ParseTransformInfo(node, tempTrans);
            BlockStormPos.npc_transforms.Add(tempTrans);
        }
    }
示例#2
0
    private void ParseTransformInfo(XmlNode node, IM.Transform iMtrans)
    {
        XmlNode pointNode = node.SelectSingleNode("Point");

        iMtrans.SetPosition(IM.Vector3.Parse(pointNode.InnerText));
        XmlNode rotationNode = node.SelectSingleNode("Rotation");

        iMtrans.SetRotaion(IM.Quaternion.Parse(rotationNode.InnerText));
    }
示例#3
0
    private void ReadTipOffPosConfig()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(name11);

        if (text == null)
        {
            Debug.LogError("LoadConfig Failed:" + name11);
            return;
        }

        if (TipOffPos.defenses_transform == null)
        {
            TipOffPos.defenses_transform = new List <IM.Transform>();
        }
        if (TipOffPos.offenses_transform == null)
        {
            TipOffPos.offenses_transform = new List <IM.Transform>();
        }

        XmlDocument xmlDoc      = CommonFunction.LoadXmlConfig(name11, text);
        XmlNode     root        = xmlDoc.LastChild;
        XmlNode     defenseNode = root.SelectSingleNode("DefenseNode");
        XmlNodeList defenseList = defenseNode.ChildNodes;
        int         deCount     = defenseList.Count;

        for (int i = 0; i < deCount; ++i)
        {
            XmlNode      node         = defenseList.Item(i);
            IM.Transform tempTrans    = new IM.Transform();
            XmlNode      pointNode    = node.SelectSingleNode("Point");
            XmlNode      rotationNode = node.SelectSingleNode("Rotation");
            tempTrans.SetPosition(IM.Vector3.Parse(pointNode.InnerText));
            tempTrans.SetRotaion(IM.Quaternion.Parse(rotationNode.InnerText));
            TipOffPos.defenses_transform.Add(tempTrans);
        }

        XmlNode     offenseNode = root.SelectSingleNode("OffenseNode");
        XmlNodeList offenseList = offenseNode.ChildNodes;
        int         offCount    = offenseList.Count;

        for (int i = 0; i < offCount; ++i)
        {
            XmlNode      node         = offenseList.Item(i);
            IM.Transform tempTrans    = new IM.Transform();
            XmlNode      pointNode    = node.SelectSingleNode("Point");
            XmlNode      rotationNode = node.SelectSingleNode("Rotation");
            tempTrans.SetPosition(IM.Vector3.Parse(pointNode.InnerText));
            tempTrans.SetRotaion(IM.Quaternion.Parse(rotationNode.InnerText));
            TipOffPos.offenses_transform.Add(tempTrans);
        }
    }
示例#4
0
    private void ReadBeginPosConfig()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(name2);

        if (text == null)
        {
            Debug.LogError("LoadConfig Failed:" + name2);
            return;
        }

        if (BeginPos.defenses_transform == null)
        {
            BeginPos.defenses_transform = new List <IM.Transform>();
        }
        if (BeginPos.offenses_transform == null)
        {
            BeginPos.offenses_transform = new List <IM.Transform>();
        }

        XmlDocument xmlDoc      = CommonFunction.LoadXmlConfig(name2, text);
        XmlNode     root        = xmlDoc.LastChild;
        XmlNode     defenseNode = root.SelectSingleNode("DefenseNode");
        XmlNodeList defenseList = defenseNode.ChildNodes;
        int         deCount     = defenseList.Count;

        for (int i = 0; i < deCount; ++i)
        {
            XmlNode      node      = defenseList.Item(i);
            IM.Transform tempTrans = new IM.Transform();
            ParseTransformInfo(node, tempTrans);
            BeginPos.defenses_transform.Add(tempTrans);
        }

        XmlNode     offenseNode = root.SelectSingleNode("OffenseNode");
        XmlNodeList offenseList = offenseNode.ChildNodes;
        int         offCount    = offenseList.Count;

        for (int i = 0; i < offCount; ++i)
        {
            XmlNode      node      = offenseList.Item(i);
            IM.Transform tempTrans = new IM.Transform();
            ParseTransformInfo(node, tempTrans);
            BeginPos.offenses_transform.Add(tempTrans);
        }
    }
 private void Step_Move()
 {
     match.tip = practise.tips[1];
     match.ShowGuideTip();
     match.ShowTouchGuide();
     IM.Transform move1Trans = GameSystem.Instance.MatchPointsConfig.PractiseMovePos.move1_transform;
     if (movePosGo == null)
     {
         movePosGo = new GameObject("move1Pos");
     }
     movePosGo.AddComponent <SceneTrigger>();
     movePosGo.transform.position        = (Vector3)move1Trans.position;
     movePosGo.transform.rotation        = (Quaternion)move1Trans.rotation;
     _obj_effect.transform.parent        = movePosGo.transform;
     _obj_effect.transform.localPosition = Vector3.zero;
     _obj_effect.SetActive(true);
     _tip_on_scene.SetActive(true);
     SetUIEffect(_tip_on_scene, movePosGo.transform);
     _tip_text.text = practise.tips[5];
     movePosGo.GetComponent <SceneTrigger>().onTrigger = OnTrigger;
     _step = Step.Move1;
 }
示例#6
0
    private void ReadRedboundStormConfig()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(name10);

        if (text == null)
        {
            Debug.LogError("LoadConfig Failed:" + name10);
            return;
        }

        ReboundStormPos.mainRole_transform = new IM.Transform();
        ReboundStormPos.npc_transform      = new IM.Transform();
        ReboundStormPos.shoots_transform   = new List <IM.Transform>();

        XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(name10, text);
        XmlNode     root   = xmlDoc.LastChild;

        XmlNode npcNode = root.SelectSingleNode("NPC");

        ParseTransformInfo(npcNode, ReboundStormPos.npc_transform);

        XmlNode mainRoleNode = root.SelectSingleNode("MainRole");

        ParseTransformInfo(mainRoleNode, ReboundStormPos.mainRole_transform);

        XmlNode     shootNode  = root.SelectSingleNode("ShootNode");
        XmlNodeList shoots     = shootNode.ChildNodes;
        int         shootCount = shoots.Count;

        for (int i = 0; i < shootCount; ++i)
        {
            XmlNode      node      = shoots.Item(i);
            IM.Transform tempTrans = new IM.Transform();
            ParseTransformInfo(node, tempTrans);
            ReboundStormPos.shoots_transform.Add(tempTrans);
        }
    }
    private void Step_GrabBall()
    {
        IM.Transform ballTrans = GameSystem.Instance.MatchPointsConfig.PractiseMovePos.ball_transform;
        match.mainRole.DropBall(match.mCurScene.mBall);
        match.mainRole.m_StateMachine.SetState(PlayerState.State.eStand);
        match.mCurScene.mBall.transform.localPosition = (Vector3)ballTrans.position;
        match.ResetPlayerPos();

        match.ShowGuideTip();
        match.tip = practise.tips[0];

        GameObject ballPosGo = new GameObject("ballPos");

        ballPosGo.transform.position        = (Vector3)ballTrans.position;
        ballPosGo.transform.rotation        = (Quaternion)ballTrans.rotation;
        _obj_effect.transform.parent        = ballPosGo.transform;
        _obj_effect.transform.localPosition = Vector3.zero;
        _obj_effect.SetActive(true);
        _tip_on_scene  = CreateUIEffect("Prefab/GUI/TipOnScene", ballPosGo.transform);
        _tip_text      = _tip_on_scene.transform.FindChild("Tip").GetComponent <UILabel>();
        _tip_text.text = practise.tips[4];

        _step = Step.GrabBall;
    }
示例#8
0
 private void ResetShooter(IM.Transform trans)
 {
     shooter.position = trans.position;
     shooter.forward  = IM.Vector3.forward;
 }
示例#9
0
    private void ReadGrabZonePosConfig()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(name6);

        if (text == null)
        {
            Debug.LogError("LoadConfig Failed:" + name6);
            return;
        }

        if (GrabZonePos.balls_transform == null)
        {
            GrabZonePos.balls_transform = new List <IM.Transform>();
        }
        if (GrabZonePos.zones_transform == null)
        {
            GrabZonePos.zones_transform = new List <IM.Transform>();
        }
        if (GrabZonePos.mainRole_transform == null)
        {
            GrabZonePos.mainRole_transform = new IM.Transform();
        }
        if (GrabZonePos.npc_transform == null)
        {
            GrabZonePos.npc_transform = new IM.Transform();
        }

        XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(name6, text);
        XmlNode     root   = xmlDoc.LastChild;
        //--- BallNode-----
        XmlNode     ballNode     = root.SelectSingleNode("BallNode");
        XmlNodeList ballNodeList = ballNode.ChildNodes;
        int         ballCount    = ballNodeList.Count;

        for (int i = 0; i < ballCount; ++i)
        {
            XmlNode      node      = ballNodeList.Item(i);
            IM.Transform tempTrans = new IM.Transform();
            ParseTransformInfo(node, tempTrans);
            GrabZonePos.balls_transform.Add(tempTrans);
        }

        XmlNode     zoneNode = root.SelectSingleNode("ZoneNode");
        XmlNodeList zoneList = zoneNode.ChildNodes;
        int         offCount = zoneList.Count;

        for (int i = 0; i < offCount; ++i)
        {
            XmlNode      node      = zoneList.Item(i);
            IM.Transform tempTrans = new IM.Transform();
            ParseTransformInfo(node, tempTrans);
            GrabZonePos.zones_transform.Add(tempTrans);
        }

        XmlNode mainRoleNode = root.SelectSingleNode("MainRole");

        ParseTransformInfo(mainRoleNode, GrabZonePos.mainRole_transform);

        XmlNode npcNode = root.SelectSingleNode("NPC");

        ParseTransformInfo(npcNode, GrabZonePos.npc_transform);
    }
 private void ResetNPC(IM.Transform trans)
 {
     npc.position = trans.position;
     npc.forward  = IM.Vector3.forward;
 }
示例#11
0
    override public void OnEnter(MatchState lastState)
    {
        if (m_match.m_needTipOff)
        {
            TipOffPos tipOffPos = GameSystem.Instance.MatchPointsConfig.TipOffPos;
            int       homeCnt   = m_match.m_homeTeam.GetMemberCount();
            for (int idx = 0; idx != homeCnt; idx++)
            {
                IM.Transform trOffensePos = tipOffPos.offenses_transform[idx];
                IM.Transform trDefensePos = tipOffPos.defenses_transform[idx];
                Player       homePlayer   = m_match.m_homeTeam.members[idx];
                if (homePlayer != null)
                {
                    homePlayer.position = trOffensePos.position;
                    homePlayer.rotation = trOffensePos.rotation;
                }
                Player awayPlayer = m_match.m_awayTeam.members[idx];
                if (awayPlayer != null)
                {
                    awayPlayer.position = trDefensePos.position;
                    awayPlayer.rotation = trDefensePos.rotation;
                }
            }
            m_match.m_needTipOff = false;
        }

        if (m_match.m_cam != null)
        {
            m_match.m_cam.m_Zoom.ReleaseZoom();
        }

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

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

            if (player.m_pickupDetector != null)
            {
                player.m_enablePickupDetector = true;
            }

            if (player.m_AOD != null)
            {
                player.m_AOD.visible = false;
            }

            player.m_toSkillInstance = null;
            player.m_stamina.ResetStamina();

            player.m_StateMachine.SetState(PlayerState.State.eStand);
        }

        if (m_goBeginUI == null)
        {
            m_goBeginUI = GameSystem.Instance.mClient.mUIManager.CreateUI("UIBeginCounter");
        }
        if (m_goBeginUI == null)
        {
            Debug.Log("Error -- can not find ui resource " + "UIBeginCounter");
            return;
        }
        Animation anim = m_goBeginUI.GetComponentInChildren <Animation>();

        anim.Stop();
        anim.Play("counter");

        UBasketball ball = m_match.mCurScene.mBall;

        if (ball != null && ball.m_owner != null && m_match.m_uiMatch != null && m_match.EnableCounter24())
        {
            m_match.m_uiMatch.ShowCounter(true, ball.m_owner.m_team.m_side == Team.Side.eHome);
            m_match.m_count24TimeStop = true;
        }

        ball.Reset();
        IM.Number x1 = m_match.m_homeTeam.members[0].position.x;
        IM.Number x2 = m_match.m_awayTeam.members[0].position.x;
        IM.Number z  = m_match.m_homeTeam.members[0].position.z;
        ball.SetInitPos(new IM.Vector3((x1 + x2) * IM.Number.half, fBallInitHeight, z));
        ball.m_ballState = BallState.eNone;

        if (m_match.m_uiMatch != null && m_match.EnableCounter24())
        {
            m_match.m_uiMatch.ShowCounter(true, true);

            m_match.m_gameMatchCountStop = true;
            m_match.m_count24TimeStop    = true;
        }

        if (m_match.EnableEnhanceAttr())
        {
            m_match.EnhanceAttr();
        }

        mTimer      = new GameUtils.Timer(new IM.Number(3), _OnCounterDone, 1);
        mTimerSound = new GameUtils.Timer(new IM.Number(3), PlaySound, 1);

        m_match.m_homeTeam.m_role         = GameMatch.MatchRole.eNone;
        m_match.m_awayTeam.m_role         = GameMatch.MatchRole.eNone;
        m_match.m_ruler.m_toCheckBallTeam = null;
    }
    override public void OnEnter(MatchState lastState)
    {
        base.OnEnter(lastState);

        if (m_match.m_bOverTime)
        {
            m_match.m_gameMathCountEnable = false;
        }

        m_match.CreateUI();

        m_match.ResetPlayerPos();
        m_match.m_cam.Positioning(true);
        m_match.m_cam.m_PositionImmediately = false;
        foreach (Player player in GameSystem.Instance.mClient.mPlayerManager)
        {
            player.m_enableAction         = false;
            player.m_enableMovement       = false;
            player.m_enablePickupDetector = false;
            player.Show(true);
        }

        m_match.m_cam.m_moveSpeed = m_match.m_cam.m_CloseUpRestoreSpeed;

        m_match.m_cam.m_Zoom.SetZoom(m_match.mainRole.gameObject.transform, ZoomType.ePlayerCloseUp);

        if (m_match.m_uiMatch != null)
        {
            m_match.m_gameMatchCountStop = true;
            m_match.m_count24TimeStop    = true;
        }

        Team oppoTeam = m_match.mainRole.m_team.m_side == Team.Side.eAway ? m_match.m_homeTeam : m_match.m_awayTeam;

        foreach (Player member in oppoTeam.members)
        {
            if (member.model != null)
            {
                member.model.EnableGrey();
            }
        }

        Color yellow = new Color(1f, 252f / 255, 10f / 255, 1);

        m_match.mainRole.ShowIndicator(yellow, true);

        //if (m_match.m_mainRole.m_inputDispatcher == null && m_match.GetMatchType() != GameMatch.Type.e3AIOn3AI )
        //	m_match.m_mainRole.m_inputDispatcher = new InputDispatcher (m_match, m_match.m_mainRole);

        //reset position
        if (m_match.m_needTipOff)
        {
            TipOffPos tipOffPos = GameSystem.Instance.MatchPointsConfig.TipOffPos;
            int       homeCnt   = m_match.m_homeTeam.GetMemberCount();
            for (int idx = 0; idx != homeCnt; idx++)
            {
                IM.Transform trOffensePos = tipOffPos.offenses_transform[idx];
                IM.Transform trDefensePos = tipOffPos.defenses_transform[idx];
                Player       homePlayer   = m_match.m_homeTeam.members[idx];
                if (homePlayer != null)
                {
                    homePlayer.position = trOffensePos.position;
                    homePlayer.rotation = trOffensePos.rotation;
                }
                Player awayPlayer = m_match.m_awayTeam.members[idx];
                if (awayPlayer != null)
                {
                    awayPlayer.position = trDefensePos.position;
                    awayPlayer.rotation = trDefensePos.rotation;
                }
            }
            m_match.m_needTipOff = false;
        }

        if (m_match.m_bOverTime)
        {
            timer2 = new GameUtils.Timer(BEGIN_WAIT_TIME, () => m_stateMachine.SetState(State.eTipOff), 1);
        }
        else
        {
            timer1 = new GameUtils.Timer4View((float)BEGIN_WAIT_TIME, GameMsgSender.SendGameBegin, 1);
        }
    }