修正TargetUI初始化StayMode Button可使用的问题 修正TargetUI可使用按钮逻辑问题 修正TargetUI与TargetController联动问题 修正Enemy击杀后不死亡问题
27 lines
705 B
C#
27 lines
705 B
C#
using UnityEngine;
|
|
|
|
public class MousePreview : MonoBehaviour
|
|
{
|
|
// show mousePreviewObj in mouse position
|
|
public void ChangePreviewTo(GameObject mousePreviewObj)
|
|
{
|
|
DeleteAllPreviewModele();
|
|
Instantiate(mousePreviewObj, transform.position, Quaternion.identity, this.transform);
|
|
}
|
|
|
|
public void UpdatePreviewPosition(Vector3 previewPos)
|
|
{
|
|
// move this gameobject to previewPos
|
|
transform.position = previewPos;
|
|
}
|
|
|
|
public void DeleteAllPreviewModele()
|
|
{
|
|
// delete all child object
|
|
foreach (Transform childObj in this.transform)
|
|
{
|
|
// destroy child
|
|
Destroy(childObj.gameObject);
|
|
}
|
|
}
|
|
} |