/// <summary>
    /// 设置玩家倒计时现实状态
    /// </summary>
    public void SetActivePlayerTime(SSGameDataCtrl.PlayerIndex index, bool isActive)
    {
        if (isActive)
        {
            if (!SSGameDataCtrl.GetInstance().m_PlayerData[(int)index].IsActiveGame ||
                !SSGameDataCtrl.GetInstance().m_PlayerData[(int)index].IsCreateGameBall)
            {
                return;
            }
        }

        switch (index)
        {
        case SSGameDataCtrl.PlayerIndex.Player01:
        {
            if (m_TimeP1 != null)
            {
                m_TimeP1.SetActive(isActive);
            }
            break;
        }

        case SSGameDataCtrl.PlayerIndex.Player02:
        {
            if (m_TimeP2 != null)
            {
                m_TimeP2.SetActive(isActive);
            }
            break;
        }
        }
    }
    private void ClickTVYaoKongUpBtEvent(InputEventCtrl.ButtonState val)
    {
        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_GameErWeiMa != null)
        {
            //有引导界面时,不允许使用遥控器上键激活玩家.
            return;
        }

        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_FuHuoDaoJu != null)
        {
            //有复活道具购买界面时,不允许使用遥控器上键激活玩家.
            return;
        }

        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_LanKuangFangDa != null)
        {
            //有篮筐放大道具购买界面时,不允许使用遥控器上键激活玩家.
            return;
        }

        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_LanQiuJianSu != null)
        {
            //有篮球减速道具购买界面时,不允许使用遥控器上键激活玩家.
            return;
        }

        if (val == InputEventCtrl.ButtonState.UP)
        {
            Debug.Log("Unity: pcvr -> ClickTVYaoKongUpBtEvent...");
            CheckActiveTvPlayer();
        }
    }
示例#3
0
    void SetAnimationModeSelect(bool isLeft)
    {
        bool isDuoRen = SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].m_GameMode == SSGameDataCtrl.GameMode.LianJi ? true : false;

        if (isLeft)
        {
            if (isDuoRen)
            {
                m_AniXuanZe.SetTrigger("IsDuoRenL");
            }
            else
            {
                m_AniXuanZe.SetTrigger("IsDanRenL");
            }
        }
        else
        {
            if (isDuoRen)
            {
                m_AniXuanZe.SetTrigger("IsDuoRenR");
            }
            else
            {
                m_AniXuanZe.SetTrigger("IsDanRenR");
            }
        }
    }
示例#4
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.IsPlayGameDaoJiShi)
        {
            //播放游戏倒计时阶段.
        }
        else
        {
            if (!SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].IsActiveGame ||
                !SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].IsCreateGameBall)
            {
                return;
            }

            if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_ExitGameUI != null)
            {
                //退出游戏界面存在时,不允许移动篮筐.
                return;
            }

            if (SSGameDataCtrl.GetInstance().IsPauseGame)
            {
                return;
            }
        }
        m_RealKuangTr.localPosition = GetRealLanKuangPosition();
    }
示例#5
0
    /// <summary>
    /// 处理购买复活道具支付界面按键事件.
    /// </summary>
    void HandleFuHuoDaoJu_ZhiFuEnterBtEvent()
    {
        UnityLog("HandleFuHuoDaoJu_ZhiFuBtEvent -> m_BtState ==== " + m_BtState);
        switch (m_BtState)
        {
        case BtState.TongYi:
        {
            FuHuoDaoJu.FuHuoCiShuState xuanXiangType = (FuHuoDaoJu.FuHuoCiShuState)SSGameDataCtrl.GetInstance().m_SSUIRoot.m_FuHuoDaoJu.m_XuanXiangState;
            SSGameDataCtrl.GetInstance().m_SSUIRoot.HandlePlayerBuyFuHuoDaoJuInfo(xuanXiangType);

            //同意购买复活道具.
            //删除复活道具垢面界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameFuHuoDaoJuPanel(m_PlayerIndex);
            //删除复活道具支付界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameFuHuoDaoJu_ZhiFuPanel();
            break;
        }

        case BtState.JuJue:
        {
            //拒绝购买复活道具.
            //删除复活道具支付界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameFuHuoDaoJu_ZhiFuPanel();
            //解锁复活道具购买界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.m_FuHuoDaoJu.SetIsLockPanel(false);
            break;
        }
        }
    }
    private void ClickTVYaoKongEnterBtEvent(InputEventCtrl.ButtonState val)
    {
        if (val == InputEventCtrl.ButtonState.DOWN)
        {
            return;
        }

        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_ExitGameUI != null)
        {
            //退出游戏界面存在时,不响应消息.
            return;
        }

        if (!gameObject.activeSelf)
        {
            return;
        }

        UnityLog("LanKuangFangDaDingBu -> ClickTVYaoKongEnterBtEvent...");
        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_LanKuangFangDa == null)
        {
            SSGameDataCtrl.PlayerIndex index = SSGameDataCtrl.GetInstance().m_CreatLanQiuStage.GetPlayerIndexDaoJu();
            SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameLanKuangFangDaPanel(index);
        }
    }
    /// <summary>
    /// 获取未激活玩家的索引. returnVal == -1 -> 所有玩家都处于激活状态.
    /// </summary>
    int GetActivePlayerIndex()
    {
        int indexPlayer = -1;

        for (int i = 0; i < SSGameDataCtrl.GetInstance().m_PlayerData.Length; i++)
        {
            if (!SSGameDataCtrl.GetInstance().m_PlayerData[i].IsActiveGame &&
                SSGameDataCtrl.GetInstance().m_PlayerData[i].GameState == SSGameDataCtrl.PlayerGameState.YouXiQian)
            {
                //玩家没有激活游戏,并且没有处于游戏中的阶段.
                indexPlayer = i;
                break;
            }
        }
        //for (int i = 0; i < m_IndexPlayerActiveGameState.Length; i++)
        //{
        //    if (m_IndexPlayerActiveGameState[i] == (int)PlayerActiveState.WeiJiHuo)
        //    {
        //        if (!m_GmWXLoginDt[i].IsLoginWX)
        //        {
        //            //未激活且未登陆过微信手柄的玩家索引.
        //            indexPlayer = i;
        //            break;
        //        }
        //    }
        //}
        return(indexPlayer);
    }
    /// <summary>
    /// 初始化连发球信息.
    /// </summary>
    void InitLianFaBallInfo()
    {
        if (!IsLianFaBall)
        {
            IsLianFaBall        = true;
            m_LastLianFaTime    = Time.time;
            m_TimeLastBallSpawn = Time.time;
            m_LianFaBallCount   = 0;

            float randVal = Random.Range(0f, 100f) / 100f;
            if (randVal < SSGameDataCtrl.GetInstance().GetBallCreatRuleDt(IndexCreatBallJieDuan).LianFaBallNum02)
            {
                //连发2球.
                m_LianFaBallNum = 2;
            }
            else
            {
                //连发3球.
                m_LianFaBallNum = 3;
            }
            //UnityLog("InitLianFaBallInfo -> m_LianFaBallNum == " + m_LianFaBallNum + ", player == " + m_PlayerIndex);

            m_TimeMinLianFa = SSGameDataCtrl.GetInstance().GetBallCreatRuleDt(IndexCreatBallJieDuan).m_TimeMinLianFa;
            int maxPointVal = SSGameDataCtrl.GetInstance().GetBallCreatRuleDt(IndexCreatBallJieDuan).MaxIndex;
            if (maxPointVal == 0 || maxPointVal > m_SpawnPointTrArray.Length)
            {
                maxPointVal = m_SpawnPointTrArray.Length;
            }
            m_IndexLianFaSpawn = Random.Range(0, 1000) % maxPointVal;
        }
    }
    internal void RemoveSelf()
    {
        //UnityLog("SSGameDaoJiShi -> RemoveSelf, m_PlayerIndex == " + m_PlayerIndex);
        switch (m_PlayerIndex)
        {
        case SSGameDataCtrl.PlayerIndex.Null:
        {
            for (int i = 0; i < SSGameDataCtrl.GetInstance().m_PlayerData.Length; i++)
            {
                SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameScoreUI((SSGameDataCtrl.PlayerIndex)i);
                SSGameDataCtrl.GetInstance().InitCreateGameBall((SSGameDataCtrl.PlayerIndex)i);
            }
            break;
        }

        default:
        {
            SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameScoreUI(m_PlayerIndex);
            SSGameDataCtrl.GetInstance().InitCreateGameBall(m_PlayerIndex);
            break;
        }
        }
        SSGameDataCtrl.GetInstance().m_CreatLanQiuStage.Init();
        Destroy(gameObject);
    }
 internal void RemoveSelf()
 {
     //UnityLog("SSGameDaoJuDaoJiShi -> RemoveSelf, m_PlayerIndex == " + m_PlayerIndex);
     Destroy(gameObject);
     //显示篮筐倒计时.
     SSGameDataCtrl.GetInstance().ShowPlayerLanKuangDaoJiShi(SSGameDataCtrl.PlayerIndex.Null, m_DaoJiShiState, m_DaoJuType);
 }
 // Use this for initialization
 void Start()
 {
     try
     {
         m_Camera = SSGameDataCtrl.GetInstance().m_SSUIRoot.m_UICameraTr.camera;
         if (InputEventCtrl.GetInstance().m_InputDevice == InputEventCtrl.InputDevice.HDD)
         {
             if (pcvr.GetInstance().m_SSBoxPostNet != null)
             {
                 if (pcvr.GetInstance().m_BarcodeCam.m_ErWeuMaImg == null)
                 {
                     string url = pcvr.GetInstance().m_SSBoxPostNet.m_BoxLoginData.hDianDianGamePadUrl;
                     pcvr.GetInstance().m_BarcodeCam.m_ErWeuMaImg = pcvr.GetInstance().m_BarcodeCam.CreateErWeiMaImg(url);
                     m_ErWeiMaUI.mainTexture = pcvr.GetInstance().m_BarcodeCam.m_ErWeuMaImg;
                     StartCoroutine(CaptureScreenshot2());
                 }
                 else
                 {
                     m_ErWeiMaUI.mainTexture = pcvr.GetInstance().m_BarcodeCam.m_ErWeuMaImg;
                 }
             }
             else
             {
                 Debug.LogWarning("Unity: m_SSBoxPostNet was null");
             }
         }
     }
     catch (System.Exception ex)
     {
         Debug.LogWarning("ex -> " + ex);
     }
 }
示例#12
0
    /// <summary>
    /// 设置篮环材质UV信息.
    /// </summary>
    void SetLanHuanMaterialUV()
    {
        m_UVRecordVal += Time.fixedDeltaTime * m_SpeedUV;
        if (m_UVRecordVal > m_MaxUVVal)
        {
            m_UVRecordVal = m_MaxUVVal;
        }

        for (int i = 0; i < m_LanHuanMat.Length; i++)
        {
            if (m_LanHuanMat.Length > i &&
                m_LanHuanMat[i] != null &&
                SSGameDataCtrl.GetInstance().m_PlayerData[i].IsActiveGame &&
                SSGameDataCtrl.GetInstance().m_PlayerData[i].IsCreateGameBall)
            {
                m_LanHuanMat[i].SetTextureOffset("_MainTex", new Vector2(m_UVRecordVal, 0));
            }
        }

        if (m_UVRecordVal >= m_MaxUVVal)
        {
            //UV动画已经结束.
            enabled = false;
        }
    }
 /// <summary>
 /// 创建篮球时间节点时间组件.
 /// </summary>
 public void CreatBallJieDuanTimeUp()
 {
     //UnityLog("CreatBallJieDuanTimeUp -> IndexCreatBallJieDuan == " + IndexCreatBallJieDuan + ", time " + Time.time);
     m_TimeUpCreatBallStageCom = gameObject.AddComponent <SSTimeUpCtrl>();
     m_TimeUpCreatBallStageCom.Init(SSGameDataCtrl.GetInstance().GetBallCreatRuleDt(IndexCreatBallJieDuan).TimeVal);
     m_TimeUpCreatBallStageCom.OnTimeUpOverEvent += OnCreatBallTimeUpOverEvent;
 }
示例#14
0
    /// <summary>
    /// 处理购买篮筐放大道具支付界面按键事件.
    /// </summary>
    void HandleLanKuangFangDa_ZhiFuEnterBtEvent()
    {
        UnityLog("HandleLanKuangFangDa_ZhiFuEnterBtEvent -> m_BtState ==== " + m_BtState);
        switch (m_BtState)
        {
        case BtState.TongYi:
        {
            //恢复篮球速度.
            SSGameDataCtrl.GetInstance().SetLanQiuMoveSpeedType(SSGameDataCtrl.LanQiuMoveSpeed.Normal);

            SSLanKuangTimeAni.DaoJiShiState daoJiShi = (SSLanKuangTimeAni.DaoJiShiState)SSGameDataCtrl.GetInstance().m_SSUIRoot.m_LanKuangFangDa.m_XuanXiangState;
            //同意购买篮筐放大道具.
            //删除购买篮筐放大道具界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameLanKuangFangDaPanel();
            //删除篮筐放大道具支付界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameLanKuangFangDa_ZhiFuPanel();
            //放大篮筐.
            if (m_PlayerIndex == SSGameDataCtrl.PlayerIndex.Null)
            {
                SSGameDataCtrl.GetInstance().m_LanKuang[(int)SSGameDataCtrl.PlayerIndex.Player01].SetLanKuangScale(SSLanKuangCtrl.LanKuangScale.Big);
                SSGameDataCtrl.GetInstance().m_LanKuang[(int)SSGameDataCtrl.PlayerIndex.Player02].SetLanKuangScale(SSLanKuangCtrl.LanKuangScale.Big);
                //显示篮筐倒计时.
                //SSGameDataCtrl.GetInstance().ShowPlayerLanKuangDaoJiShi(m_PlayerIndex, daoJiShi, SSLanKuangTimeAni.DaoJuState.LanKuangFangDa);
                //显示道具启动倒计时.
                SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameDaoJuDaoJiShiUI(daoJiShi, SSLanKuangTimeAni.DaoJuState.LanKuangFangDa);
            }
            else
            {
                if (SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].IsJieShouTiaoZhan)
                {
                    SSGameDataCtrl.GetInstance().m_LanKuang[(int)SSGameDataCtrl.PlayerIndex.Player01].SetLanKuangScale(SSLanKuangCtrl.LanKuangScale.Big);
                    SSGameDataCtrl.GetInstance().m_LanKuang[(int)SSGameDataCtrl.PlayerIndex.Player02].SetLanKuangScale(SSLanKuangCtrl.LanKuangScale.Big);
                    //显示篮筐倒计时.
                    //SSGameDataCtrl.GetInstance().ShowPlayerLanKuangDaoJiShi(SSGameDataCtrl.PlayerIndex.Null, daoJiShi, SSLanKuangTimeAni.DaoJuState.LanKuangFangDa);
                    //显示道具启动倒计时.
                    SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameDaoJuDaoJiShiUI(daoJiShi, SSLanKuangTimeAni.DaoJuState.LanKuangFangDa);
                }
                else
                {
                    SSGameDataCtrl.GetInstance().m_LanKuang[(int)m_PlayerIndex].SetLanKuangScale(SSLanKuangCtrl.LanKuangScale.Big);
                    //显示篮筐倒计时.
                    //SSGameDataCtrl.GetInstance().ShowPlayerLanKuangDaoJiShi(m_PlayerIndex, daoJiShi, SSLanKuangTimeAni.DaoJuState.LanKuangFangDa);
                    //显示道具启动倒计时.
                    SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameDaoJuDaoJiShiUI(daoJiShi, SSLanKuangTimeAni.DaoJuState.LanKuangFangDa);
                }
            }
            break;
        }

        case BtState.JuJue:
        {
            //拒绝购买篮筐放大道具.
            //删除篮筐放大道具支付界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameLanKuangFangDa_ZhiFuPanel();
            //解锁篮筐放大道具购买界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.m_LanKuangFangDa.SetIsLockPanel(false);
            break;
        }
        }
    }
示例#15
0
    private void ClickTVYaoKongExitBtEvent(InputEventCtrl.ButtonState val)
    {
        if (val == InputEventCtrl.ButtonState.DOWN)
        {
            return;
        }

        switch (val)
        {
        case InputEventCtrl.ButtonState.DOWN:
        {
            ClickTVYaoKongLeftBtEvent(val);
            QuXiaoUI.mainTexture = QuXiaoImg[1];
            break;
        }

        case InputEventCtrl.ButtonState.UP:
        {
            QuXiaoUI.mainTexture = QuXiaoImg[0];
            Debug.Log("Unity:" + "Player close exit game ui...");
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveExitGameDlg(ExitEnum.QuXiao);
            break;
        }
        }
    }
    private void OnEventPlayerLoginBox(WebSocketSimpet.PlayerWeiXinData val)
    {
        Debug.Log("pcvr::OnEventPlayerLoginBox -> userName " + val.userName + ", userId " + val.userId);
        GamePlayerData playerDt = m_GamePlayerData.Find((dt) => {
            if (dt.m_PlayerWeiXinData != null)
            {
                return(dt.m_PlayerWeiXinData.userId.Equals(val.userId));
            }
            return(dt.m_PlayerWeiXinData.Equals(val));
        });

        int  indexPlayer    = -1;
        bool isActivePlayer = false;

        if (playerDt == null)
        {
            indexPlayer = GetActivePlayerIndex();
            if (indexPlayer > -1 && indexPlayer < m_MaxPlayerNum)
            {
                Debug.Log("Active player, indexPlayer == " + indexPlayer);
                playerDt = new GamePlayerData();
                playerDt.m_PlayerWeiXinData = val;
                playerDt.Index = indexPlayer;
                m_GamePlayerData.Add(playerDt);
                isActivePlayer = true;
            }
            else
            {
                Debug.Log("have not empty player!");
            }
        }
        else
        {
            Debug.Log("player have active game!");
            playerDt.IsExitWeiXin = false;
            if (playerDt.Index > -1 && playerDt.Index < m_MaxPlayerNum)
            {
                if (m_IndexPlayerActiveGameState[playerDt.Index] == (int)PlayerActiveState.WeiJiHuo)
                {
                    isActivePlayer = true;
                    indexPlayer    = playerDt.Index;
                }
            }
        }

        if (isActivePlayer)
        {
            switch (indexPlayer)
            {
            case 0:
            case 1:
            {
                SSGameDataCtrl.GetInstance().m_PlayerData[indexPlayer].PlayerHeadUrl = playerDt.m_PlayerWeiXinData.headUrl;
                InputEventCtrl.GetInstance().ClickStartBt((SSGameDataCtrl.PlayerIndex)indexPlayer, InputEventCtrl.ButtonState.DOWN);
                break;
            }
            }
        }
    }
    void Start()
    {
        chile            = 0;
        m_pScale.enabled = false;

        if (SSGameDataCtrl.GetInstance() != null)
        {
            Debug.Log("fix game ui data...");
            m_pGameTime = SSGameDataCtrl.GetInstance().m_UIData.m_pGameTime;
            Distance    = SSGameDataCtrl.GetInstance().m_UIData.Distance;
        }
        else
        {
            Debug.LogWarning("not find SSGameDataCtrl...");
        }

        int gradeVal = ReadGameInfo.GetInstance().ReadGrade();

        switch (gradeVal)
        {
        case 1:     //低.
        {
            m_pGameTime += 15f;
            break;
        }

        case 2:     //中.
        {
            break;
        }

        case 3:     //高.
        {
            m_pGameTime -= 10f;
            break;
        }

        default:
        {
            break;
        }
        }

        m_pGameTime += 1;
        m_totalTime  = (int)m_pGameTime;
        XkGameCtrl.IsLoadingLevel = false;
        ShowJiFenInfo(0);
        UpdateGameTime();
        m_SSUICenterCom = gameObject.AddComponent <SSUICenter>();
        if (m_UICamera != null)
        {
            m_SSUICenterCom.Init(m_UICamera.transform);
        }

        InputEventCtrl.GetInstance().OnCaiPiaJiChuPiaoEvent += OnCaiPiaJiChuPiaoEvent;
        InputEventCtrl.GetInstance().OnCaiPiaJiWuPiaoEvent += OnCaiPiaJiWuPiaoEvent;
        InputEventCtrl.GetInstance().mListenPcInputEvent.ClickTVYaoKongExitBtEvent += ClickTVYaoKongExitBtEvent;
    }
 /// <summary>
 /// 动画结束事件.
 /// </summary>
 public override void OnEndAnimationTrigger()
 {
     if (IsRemoveSelf)
     {
         return;
     }
     IsRemoveSelf = true;
     SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameDaoJuDaoJiShiUI();
 }
 internal void Init(SSGameDataCtrl.PlayerIndex index)
 {
     m_PlayerIndex = index;
     if (index != SSGameDataCtrl.PlayerIndex.Null)
     {
         SSGameDataCtrl.GetInstance().m_PlayerData[(int)index].IsActiveLianJiWaitUI = true;
     }
     InputEventCtrl.GetInstance().OnClickStartBtEvent += OnClickStartBtEvent;
 }
    public void RemoveSelf()
    {
        if (IsRemoveSelf)
        {
            return;
        }
        IsRemoveSelf = true;

        if (m_PlayerIndex != SSGameDataCtrl.PlayerIndex.Null)
        {
            if (SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].IsJieShouTiaoZhan)
            {
                //玩家PK模式下.
                for (int i = 0; i < SSGameDataCtrl.GetInstance().m_PlayerData.Length; i++)
                {
                    if (SSGameDataCtrl.GetInstance().m_BallSpawnArray[i].IndexCreatBallJieDuan == SSGameDataCtrl.GetInstance().IndexJieDuanFangDaLanKuang - 1)
                    {
                        //发球阶段在2时,增加发球阶段索引.
                        //SSGameDataCtrl.GetInstance().m_BallSpawnArray[i].AddIndexCreatBallJieDuan();
                        SSGameDataCtrl.GetInstance().m_CreatLanQiuStage.AddIndexCreatBallJieDuan();
                    }
                }
            }
            else
            {
                if (SSGameDataCtrl.GetInstance().m_BallSpawnArray[(int)m_PlayerIndex].IndexCreatBallJieDuan == SSGameDataCtrl.GetInstance().IndexJieDuanFangDaLanKuang - 1)
                {
                    //发球阶段在2时,增加发球阶段索引.
                    //SSGameDataCtrl.GetInstance().m_BallSpawnArray[(int)m_PlayerIndex].AddIndexCreatBallJieDuan();
                    SSGameDataCtrl.GetInstance().m_CreatLanQiuStage.AddIndexCreatBallJieDuan();
                }
            }
            //SSGameDataCtrl.GetInstance().TestResetPlayerLanKuang(m_PlayerIndex); //test.
        }
        else
        {
            //玩家PK或者玩家主动触发道具购买.
            for (int i = 0; i < SSGameDataCtrl.GetInstance().m_PlayerData.Length; i++)
            {
                if (SSGameDataCtrl.GetInstance().m_BallSpawnArray[i].IndexCreatBallJieDuan == SSGameDataCtrl.GetInstance().IndexJieDuanFangDaLanKuang - 1)
                {
                    //发球阶段在2时,增加发球阶段索引.
                    //SSGameDataCtrl.GetInstance().m_BallSpawnArray[i].AddIndexCreatBallJieDuan();
                    SSGameDataCtrl.GetInstance().m_CreatLanQiuStage.AddIndexCreatBallJieDuan();
                }
            }
        }

        SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameLanKuangFangDaDingBuPanel();
        SSGameDataCtrl.GetInstance().IsPauseGame = false;

        InputEventCtrl.GetInstance().ClickTVYaoKongEnterBtEvent -= ClickTVYaoKongEnterBtEvent;
        InputEventCtrl.GetInstance().ClickTVYaoKongLeftBtEvent  -= ClickTVYaoKongLeftBtEvent;
        InputEventCtrl.GetInstance().ClickTVYaoKongRightBtEvent -= ClickTVYaoKongRightBtEvent;
        Destroy(gameObject);
    }
示例#21
0
 public void RemoveSelf()
 {
     //删除退出游戏对话框事件.
     SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveExitGameUIEvent();
     InputEventCtrl.GetInstance().ClickTVYaoKongEnterBtEvent -= ClickTVYaoKongEnterBtEvent;
     InputEventCtrl.GetInstance().ClickTVYaoKongExitBtEvent  -= ClickTVYaoKongExitBtEvent;
     InputEventCtrl.GetInstance().ClickTVYaoKongLeftBtEvent  -= ClickTVYaoKongLeftBtEvent;
     InputEventCtrl.GetInstance().ClickTVYaoKongRightBtEvent -= ClickTVYaoKongRightBtEvent;
     Destroy(gameObject);
 }
示例#22
0
    public void Init(SSGameDataCtrl.PlayerIndex index)
    {
        m_PlayerIndex = index;
        SSGameDataCtrl.GetInstance().m_PlayerData[(int)index].m_GameMode       = SSGameDataCtrl.GameMode.DanJi;
        SSGameDataCtrl.GetInstance().m_PlayerData[(int)index].IsChooseGameMode = false;
        //SetAnimationModeSelect(true);

        InputEventCtrl.GetInstance().OnClickStartBtEvent    += OnClickStartBtEvent;
        InputEventCtrl.GetInstance().OnClickLeftHorBtEvent  += OnClickLeftHorBtEvent;
        InputEventCtrl.GetInstance().OnClickRightHorBtEvent += OnClickRightHorBtEvent;
    }
 /// <summary>
 /// 动画结束事件.
 /// </summary>
 public override void OnEndAnimationTrigger()
 {
     if (IsRemoveSelf)
     {
         return;
     }
     IsRemoveSelf = true;
     SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameDaoJiShiUI(m_PlayerIndex);
     SSGameDataCtrl.GetInstance().m_AudioData.PlayGameBeiJingAudio();
     SSGameDataCtrl.GetInstance().m_CreatLanQiuStage.CreatBallJieDuanTimeUp();
 }
    void FixedUpdate()
    {
        if (m_BallAni == null)
        {
            return;
        }

        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_ExitGameUI != null)
        {
            //退出游戏界面存在时,停止篮球运动.
            return;
        }

        if (!IsRemoveSelf)
        {
            if (SSGameDataCtrl.GetInstance().m_TriggerRemoveBall != null)
            {
                Vector3 triggerPos = SSGameDataCtrl.GetInstance().m_TriggerRemoveBall.transform.position;
                float   disRemove  = 15f;
                if (SSGameDataCtrl.GetInstance().IsStopCreatBall)
                {
                    disRemove = 8f;
                }

                if (transform.position.y < triggerPos.y - disRemove)
                {
                    IsRemoveSelf   = true;
                    IsInitMoveBall = false;
                    //UnityLog("Remove the ball, time == " + Time.time.ToString("f3"));
                    m_BallAni.StartCoroutine(m_BallAni.DelayDestroyThis(0.1f));
                }
            }
        }

        if (!IsInitMoveBall)
        {
            //if (m_Rigidbody != null && m_Rigidbody.useGravity)
            //{
            //    Vector3 ballDownPos = transform.localPosition;
            //    ballDownPos.y -= 0.15f;
            //    transform.localPosition = ballDownPos;
            //}
            return;
        }

        m_MoveCount++;
        Vector3 ballPos = Vector3.zero;
        float   timeZ   = Time.fixedDeltaTime;
        float   timeVal = timeZ * m_MoveCount * m_BallMoveSpeedBeiLv;

        ballPos.z = timeVal * m_SpeedZ;
        ballPos.y = m_SpeedY * timeVal + 0.5f * m_JiaSuDu * Mathf.Pow(timeVal, 2f);
        transform.localPosition = ballPos;
    }
示例#25
0
    /// <summary>
    /// 处理是否接受挑战支付界面按键事件.
    /// </summary>
    void HandleShiFouJieShouTiaoZhan_ZhiFuEnterBtEvent()
    {
        UnityLog("HandleShiFouJieShouTiaoZhan_ZhiFuEnterBtEvent -> m_BtState ==== " + m_BtState);
        switch (m_BtState)
        {
        case BtState.TongYi:
        {
            //清理最后一个结束游戏玩家的数据.
            SSGameDataCtrl.GetInstance().CleanLastOverPlayerData();
            //激活该玩家.
            SSGameDataCtrl.GetInstance().SetActivePlayer(m_PlayerIndex, true);
            //删除等待对方同意PK.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveDengDaiDuiFangTongYiPK();
            //删除对方不敢应战,请继续等待.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveDuiFangBuYingZhan_JiXuDengDai();
            //同意购买挑战对方道具.
            SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].IsJieShouTiaoZhan = true;
            //删除购买挑战对方道具界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameShiFouJieShouTiaoZhanPanel();
            //删除挑战对方道具支付界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameShiFouJieShouTiaoZhan_ZhiFuPanel();

            if (SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].GameState == SSGameDataCtrl.PlayerGameState.YouXiQian)
            {
                //游戏前.
                //产生开始双人PK提示.
                SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnKaiShiShuangRenPK();
            }
            else
            {
                //游戏中.
                //产生购买复活道具界面.
                SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameFuHuoDaoJuPanel(m_PlayerIndex);
            }
            break;
        }

        case BtState.JuJue:
        {
            //拒绝购买挑战对方道具.
            //删除挑战对方道具支付界面.
            SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameShiFouJieShouTiaoZhan_ZhiFuPanel();
            //解锁挑战对方道具购买界面.
            SSGameDlgUI dlg = SSGameDataCtrl.GetInstance().m_SSUIRoot.m_SSGameDlgManage.FindGameDlgByType(GameDlgState.ShiFouJieShouTiaoZhan);
            if (dlg != null)
            {
                dlg.SetIsLockPanel(false);
            }
            break;
        }
        }
    }
 internal void Init(SSGameDataCtrl.PlayerIndex indexVal)
 {
     SSGameDataCtrl.GetInstance().m_PlayerData[(int)indexVal].m_GameScoreCom = this;
     SetActiveDeFenWang(false);
     ShowPlayerScore(SSGameDataCtrl.GetInstance().m_PlayerData[(int)indexVal].Score);
     if (m_UIPosTr != null && m_UIPosX.Length > (int)indexVal)
     {
         //动态修改UI坐标.
         Vector3 posTmp = m_UIPosTr.localPosition;
         posTmp.x = m_UIPosX[(int)indexVal];
         m_UIPosTr.localPosition = posTmp;
     }
 }
    private void ClickTVYaoKongEnterBtEvent(InputEventCtrl.ButtonState val)
    {
        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_GameErWeiMa == null)
        {
            return;
        }

        if (val == InputEventCtrl.ButtonState.UP)
        {
            Debug.Log("Unity: pcvr -> ClickTVYaoKongEnterBtEvent...");
            CheckActiveTvPlayer();
        }
    }
示例#28
0
    void Start()
    {
        chile            = 0;
        m_pScale.enabled = false;

        if (SSGameDataCtrl.GetInstance() != null)
        {
            Debug.Log("fix game ui data...");
            m_pGameTime = SSGameDataCtrl.GetInstance().m_UIData.m_pGameTime;
            Distance    = SSGameDataCtrl.GetInstance().m_UIData.Distance;
        }
        else
        {
            Debug.LogWarning("not find SSGameDataCtrl...");
        }

        int gradeVal = ReadGameInfo.GetInstance().ReadGrade();

        switch (gradeVal)
        {
        case 1:     //低.
        {
            m_pGameTime += 15f;
            break;
        }

        case 2:     //中.
        {
            break;
        }

        case 3:     //高.
        {
            m_pGameTime -= 10f;
            break;
        }

        default:
        {
            break;
        }
        }

        m_pGameTime += 1;
        m_totalTime  = (int)m_pGameTime;
        XkGameCtrl.IsLoadingLevel = false;
        ShowJiFenInfo(0);
        UpdateGameTime();
        InputEventCtrl.GetInstance().OnCaiPiaJiChuPiaoEvent += OnCaiPiaJiChuPiaoEvent;
        InputEventCtrl.GetInstance().OnCaiPiaJiWuPiaoEvent  += OnCaiPiaJiWuPiaoEvent;
    }
示例#29
0
    IEnumerator DelayDestroyThis(float time)
    {
        yield return(new WaitForSeconds(time));

        switch (m_DestroyState)
        {
        case DestroyState.LanHuanExp:
        {
            SSGameDataCtrl.GetInstance().RemoveLanHuanExplosionToList(gameObject);
            break;
        }
        }
        Destroy(gameObject);
    }
示例#30
0
    private void ClickTVYaoKongRightBtEvent(InputEventCtrl.ButtonState val)
    {
        if (val == InputEventCtrl.ButtonState.DOWN)
        {
            return;
        }

        if (SSGameDataCtrl.GetInstance().m_SSUIRoot.m_ExitGameUI != null)
        {
            //退出游戏界面存在时,不响应消息.
            return;
        }
        SetXuanXiangKuangPos(SSGameDataCtrl.XuanXiangMoveDir.Right);
    }