73 lines
1.3 KiB
C#
73 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using ZXKFramework;
|
|
using System;
|
|
public class InsectPinModel : MonoBehaviour
|
|
{
|
|
public GameObject[] True;
|
|
public GameObject[] False;
|
|
public Action<bool> CBClick;
|
|
//public Action CBFalse;
|
|
|
|
|
|
public void Begin()
|
|
{
|
|
foreach (GameObject isT in True)
|
|
{
|
|
isT.SetActive(true);
|
|
isT.GetComponent<MouseClickObj>().down = DoTrue;
|
|
}
|
|
|
|
foreach (GameObject isF in False)
|
|
{
|
|
isF.SetActive(true);
|
|
isF.GetComponent<MouseClickObj>().down = DoFalse;
|
|
}
|
|
}
|
|
|
|
public void End()
|
|
{
|
|
foreach (GameObject isT in True)
|
|
{
|
|
isT.GetComponent<MouseClickObj>().down = null;
|
|
isT.SetActive(false);
|
|
}
|
|
|
|
foreach (GameObject isF in False)
|
|
{
|
|
isF.GetComponent<MouseClickObj>().down = null;
|
|
isF.SetActive(false);
|
|
}
|
|
}
|
|
|
|
|
|
void DoTrue(GameObject t)
|
|
{
|
|
End();
|
|
CBClick.Invoke(true);
|
|
}
|
|
|
|
void DoFalse(GameObject f)
|
|
{
|
|
CBClick.Invoke(false);
|
|
return;
|
|
}
|
|
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|