35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using DG.Tweening;
|
|
|
|
public class ClampAmmetersInteractive : MonoBehaviour
|
|
{
|
|
public bool isInteractive;
|
|
public GameObject g1;
|
|
private void Start()
|
|
{
|
|
transform.AddComponent<MeshCollider>();
|
|
}
|
|
[ContextMenu("ÔËÐÐ")]
|
|
void init()
|
|
{
|
|
g1 = transform.GetChild(0).gameObject;
|
|
//Destroy(g1.GetComponent<MeshFilter>());
|
|
//Destroy(g1.GetComponent<MeshRenderer>());
|
|
//Destroy(g1.GetComponent<BoxCollider>());
|
|
}
|
|
private void OnMouseDown()
|
|
{
|
|
//Debug.Log("ok");
|
|
if (GameManager.ins.temp.transform!=null)
|
|
{
|
|
GameManager.ins.temp.transform.parent = g1.transform;
|
|
GameManager.ins.temp.transform.DOLocalRotate(new Vector3(44.98f, 0, 0), 0.25f);
|
|
GameManager.ins.temp.transform.DOScale(new Vector3(20, 20, 20), 0.25f);
|
|
GameManager.ins.temp.transform.DOLocalMove(new Vector3(1.04f, -3.91f, 3.82f), 0.25f);
|
|
}
|
|
}
|
|
}
|