ShanxiKnowledgeBase/SXElectricalInspection/Assets/Script/Playercontrol/flow3_InteractiveObject.cs

58 lines
1.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class flow3_InteractiveObject : ToolBase
{
public GameObject mubiao;
public Animator ;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
//private void OnTriggerEnter(Collider other)
//{
// if (other.name == "Player")
// {
// Debug.Log("up");
// other.transform.position = mubiao.transform.position;
// }
//}
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.name == "Player")
{
Debug.Log("up");
collision.transform.position = mubiao.transform.position;
//collision.rigidbody.AddForce(0, 100, 10);
.Play("配电箱门打开");
}
}
private void OnTriggerExit(Collider other)
{ if (other.name == "Player")
{
.Play("配电箱门关闭"); }
}
}