Example #1
0
 /// <summary>
 /// 击球完成,记录击球操作.
 /// </summary>
 /// <param name="IsSelf"></param>
 /// <param name="OperateTimes"></param>
 /// <param name="v"></param>
 private static void AddBattleOperate(bool IsSelf, int OperateTimes, BattleOperateInfo v)
 {
     if (g_CurBattle != null)
     {
         g_CurBattle.AddBattleOperate(IsSelf, OperateTimes, v);
     }
 }
Example #2
0
        /// <summary>
        /// 添加战斗操作数据
        /// </summary>
        /// <param name="IsSelf"></param>
        /// <param name="OperateTimes"></param>
        /// <param name="v"></param>
        /// <returns></returns>
        public bool AddBattleOperate(bool IsSelf, int OperateTimes, BattleOperateInfo v)
        {
            List <BattleOperateInfo> l = GetOperateList(IsSelf);

            if (l == null || v == null)
            {
                return(false);
            }
            if (l.Count != OperateTimes - 1)
            {
                return(false);
            }
            else
            {
                l.Add(new BattleOperateInfo(v));
                if (IsSelf == true)
                {
                    m_SelfOperateTimes = OperateTimes;
                }
                else
                {
                    m_PlayerOperateTimes = OperateTimes;
                }
                return(true);
            }
        }
Example #3
0
        /// <summary>
        /// 设置五环的位置及所需要的速度
        /// </summary>
        private static void SetRingPosAndNeedSpeed(Vector3 BullseyePos, Vector3 NeedSpeed, bool isSelf)
        {
            BattleOperateInfo op = GetBattleOperateInfo(isSelf);

            if (op != null)
            {
                op.SetNeedSpeed(NeedSpeed);
                op.SetBullseyePos(BullseyePos);
            }
        }
Example #4
0
 public BattleOperateInfo(BattleOperateInfo a)
 {
     this.m_StartPos          = a.m_StartPos;
     this.m_BallSpeed         = a.m_BallSpeed;
     this.m_BullseyePos       = a.m_BullseyePos;
     this.m_NeedSpeed         = a.m_NeedSpeed;
     this.m_ResultPos         = a.m_ResultPos;
     this.m_WindSpeed         = a.m_WindSpeed;
     this.m_CurFBSpin         = a.m_CurFBSpin;
     this.m_CurLRSpin         = a.m_CurLRSpin;
     this.m_CurHookAngle      = a.m_CurHookAngle;
     this.m_CurAccuracyOffset = a.m_CurAccuracyOffset;
     this.m_Ball = new BallInfo(a.m_Ball);
     this.m_Club = new ClubInfo(a.m_Club);
 }
Example #5
0
        /// <summary>
        /// 发球
        /// </summary>
        private static void RoundFireBall(object Param)
        {
            if (Param == null)
            {
                return;
            }
            BattingParam param    = Param as BattingParam;
            GolfPathInfo pathInfo = GetPath(param);

            EventCenter.DispatchEvent(EventCenterType.Battle_BattingFinish, -1, pathInfo);
            EventCenter.DispatchEvent(EventCenterType.Battle_ShowRing, -1, false);
            m_SelfSel.SetBallSpeed(param.BattingSpeed);
            m_SelfSel.SetWindSpeed(param.WindSpeed);
            m_SelfSel.SetCurFBSpin(param.CurFBSpin);
            m_SelfSel.SetCurLRSpin(param.CurLRSpin);
            m_SelfSel.SetCurHookAngle(param.CurHookAngle);
            m_SelfSel.SetCurAccuracyOffset(param.CurAccuracyOffset);
            m_SelfSel.SetResultPos(pathInfo.GetRuseltPos());
            BattleOperateInfo v = new BattleOperateInfo(m_SelfSel);

            AddBattleOperate(true, g_Times, v);
        }