48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
public class TipShowX : BaseShow, IComparable
|
|||
|
|
{
|
|||
|
|
public int CompareTo(object obj)
|
|||
|
|
{
|
|||
|
|
TipShow another = obj as TipShow;
|
|||
|
|
return
|
|||
|
|
Vector3.Distance(
|
|||
|
|
CommonData.MainCamera.transform.position,
|
|||
|
|
ResetVector3_Y( another.transform.position)
|
|||
|
|
)
|
|||
|
|
.CompareTo(Vector3.Distance(
|
|||
|
|
CommonData.MainCamera.transform.position,
|
|||
|
|
ResetVector3_Y(transform.position)
|
|||
|
|
));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Vector3 ResetVector3_Y(Vector3 pos, float y = 0)
|
|||
|
|
{
|
|||
|
|
return new Vector3(pos.x, y, pos.z);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//public bool isplay;
|
|||
|
|
//void OnBecameVisible() //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ұ
|
|||
|
|
//{
|
|||
|
|
// Debug.Log(gameObject.name + "In");
|
|||
|
|
//}
|
|||
|
|
//void OnBecameInvisible() //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뿪<EFBFBD><EBBFAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ұ
|
|||
|
|
//{
|
|||
|
|
// Debug.Log(gameObject.name + "Out");
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
//void Update()
|
|||
|
|
//{
|
|||
|
|
// Vector3 screenCenter = new Vector3(Screen.width / 2, Screen.height / 2, 0);
|
|||
|
|
// Vector3 objectPosition = CommonData.MainCamera.WorldToScreenPoint(transform.position);
|
|||
|
|
// if (objectPosition.x >= screenCenter.x && objectPosition.x <= screenCenter.x + Screen.width &&
|
|||
|
|
// objectPosition.y >= screenCenter.y && objectPosition.y <= screenCenter.y + Screen.height)
|
|||
|
|
// {
|
|||
|
|
// Debug.Log(gameObject.name + "In");
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
}
|