40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace ZXKFramework
|
|
{
|
|
public class AdsorbItem : MonoBehaviour
|
|
{
|
|
public float distance = 1f;
|
|
public float time = 1f;
|
|
private TransformHoming loTransformHoming = new TransformHoming();
|
|
|
|
void Awake()
|
|
{
|
|
loTransformHoming.Init(transform);
|
|
}
|
|
|
|
public void CheakHoming()
|
|
{
|
|
//if (Vector3.Distance(transform.position, loTransformHoming.pos) < distance)
|
|
//{
|
|
// DOTweenTools.Move(transform, loTransformHoming, time);
|
|
//}
|
|
|
|
//Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
|
|
|
//RaycastHit[] hits = Physics.RaycastAll(ray, 10000);
|
|
////RaycastHit2D[] hits = Physics2D.GetRayIntersectionAll(ray);
|
|
//for (int i = 0; i < hits.Length; i++)
|
|
//{
|
|
// if (hits[i].collider.name.Equals($"{transform.name}_OutLine"))
|
|
// {
|
|
DOTweenTools.Move(transform, loTransformHoming, time);
|
|
transform.GetComponent<MouseMoveObj>().enabled = false;
|
|
transform.GetComponent<Collider>().enabled = false;
|
|
//}
|
|
//}
|
|
}
|
|
}
|
|
} |