using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Player : MonoBehaviour
{
//需要“挤开”的物体数组
public GameObject[] targets;
//需要“挤开”的物体的边界框
Bounds[] targetBound;
//自身的边界框
Bounds bound;
//虚拟一个平面用来判断目标位于自身的左边或右边
Plane plane;
//自身与目标物体的半径和
Vector2[] dis;
//鼠标点击的点
Vector2 clickPoint = Vector2.zero;
//是否移动
bool isMove;
【Unity】实现“挤开”效果(不使用自带物理引擎)
最新推荐文章于 2025-02-16 08:45:40 发布