E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/Playercontrol/door_control.cs

58 lines
1.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using MyFrameworkPure;
using CommonScript;
public class door_control : MonoBehaviour
{
[SerializeField] private MouseButton mouseButton = MouseButton.Left;
public bool = false;
public bool = false;
public GameObject ;
public string ;
public string ;
public Animator animator;
// Start is called before the first frame update
void Start()
{
EventTriggerListener.Get(transform.gameObject).onClick_Data += Onclick;
}
void Onclick(GameObject go,PointerEventData e) {
if (.activeSelf == true)
return;
if(e.button != (PointerEventData.InputButton)mouseButton)
return;
// 是否开门 = !是否开门;
if ( == true)
{//sssssssss
= !;
if ( == true)
{
//是否开门 = false;
animator.Play();
//是否开门 = false;
}
else
{
//是否开门 = true;
animator.Play();
//是否开门 = true;
}
}
return;
}
// Update is called once per frame
void Update()
{
}
}