53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using DG.Tweening;
|
|
|
|
public class DoolsPlayer : MonoBehaviour
|
|
{
|
|
public door_control mesh;
|
|
public MeshCollider _collider;
|
|
public bool ison = false;
|
|
public string currentObjName;
|
|
public Vector3 newPos = Vector3.zero;
|
|
public Vector3 newAngle = Vector3.zero;
|
|
// Start is called before the first frame update
|
|
private void Awake()
|
|
{
|
|
mesh.ÆôÓý»»¥ = false;
|
|
_collider = mesh.GetComponent<MeshCollider>();
|
|
}
|
|
private void OnMouseDown()
|
|
{
|
|
if (ison)
|
|
{
|
|
if (currentObjName == "·âÓ¡")
|
|
{
|
|
GameObject obj = GameManager.Instance.temp;
|
|
if (obj != null && obj.name == "¸Ö˿ǯ(Clone)")
|
|
{
|
|
GameManager.Instance.FirstPersonController.enabled = false;
|
|
obj.transform.DORotate(newAngle, 0.5f);
|
|
obj.transform.DOMove(newPos, 1f).OnComplete(() =>
|
|
{
|
|
gameObject.SetActive(false);
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
public void OnOver()
|
|
{
|
|
mesh.enabled = true;
|
|
//mesh.FengYing = true;
|
|
_collider.enabled = true;
|
|
if (GameManager.Instance)
|
|
{
|
|
GameManager.Instance.interactiveEnum = Interactive.none;
|
|
}
|
|
GameManager.Instance.YanDian = true;
|
|
}
|
|
}
|