コード例 #1
0
        private List <golfballHitData> GetPathData(pathBtnEnum pathBtnState)
        {
            List <golfballHitData> data = new List <golfballHitData>();

            switch (pathBtnState)
            {
            //case pathBtnEnum.none:
            //    break;

            case pathBtnEnum.one:
                if (GameEntry.GameData.currGolfball.Count > 0)
                {
                    data.Add(GameEntry.GameData.currGolfball[GameEntry.GameData.currGolfball.Count - 1]);
                }
                break;

            case pathBtnEnum.more:
                if (GameEntry.GameData.currGolfball.Count > 3)
                {
                    for (int i = 0; i < 3; i++)
                    {
                        data.Add(GameEntry.GameData.currGolfball[GameEntry.GameData.currGolfball.Count - 1 - i]);
                    }
                }
                else
                {
                    data = GameEntry.GameData.currGolfball;
                }
                break;
            }
            return(data);
        }
コード例 #2
0
 /// <summary>
 /// 显示球的飞行路径
 /// </summary>
 public void ShowFlightPath(pathBtnEnum pathBtnState)
 {
     hidePath();
     foreach (golfballHitData data in GetPathData(pathBtnState))
     {
         DrawPath(data.endPoint);
         data.ball.gameObject.SetActive(true);
     }
 }