123456789101112131415161718192021222324252627282930313233343536 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- [RequireComponent(typeof(Collider))]
- public class PutDownBoxManager : MonoBehaviour
- {
- private static PutDownBoxManager _putDownBoxManager;
- public static PutDownBoxManager Instance
- {
- get
- {
- if (_putDownBoxManager == null)
- {
- Debug.LogWarning("未实例化PutDownBoxManager");
- }
- return _putDownBoxManager;
- }
- }
- private void Awake()
- {
- _putDownBoxManager = this;
- _bounds = this.GetComponent<Collider>().bounds;
- }
- private Bounds _bounds;
- public bool TestBounds(Vector3 pos)
- {
- if (_bounds.Contains(pos))
- {
- return true;
- }
- return false;
- }
- }
|