using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Ball : MonoBehaviour
{
public GameObject ball;//要作用的物体
public float power = 5;//力
public int dotsValut = 30;//指示点的个数
public GameObject dotPrefab;//指示点预制体
public Transform dotsTransform;//指示点父物体
private bool mouseDown = false;//鼠标按下
private Vector3 startPos;//鼠标一开始点击的位置
private List<GameObject> dotsObjects = new List<GameObject>();//指示线点列表
void Start()
{
//物体的刚体
if (ball.transform.GetComponent<Rigidbody2D>() == null)
ball.AddComponent<
unity发射球并显示球运动的路径
最新推荐文章于 2022-11-25 11:48:36 发布