You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.5 KiB
68 lines
1.5 KiB
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Canvasinit : Singleton<Canvasinit>
|
|
{
|
|
public GameObject[] initfalse;
|
|
public GameObject[] inittrue;
|
|
public int one_active;
|
|
public int two_active;
|
|
public int three_active;
|
|
public GameObject tip1;
|
|
public GameObject tip2;
|
|
public GameObject tip3;
|
|
int onenumber=5;
|
|
int twonumber = 5;
|
|
int threenumber = 5;
|
|
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
}
|
|
private void OnEnable()
|
|
{
|
|
foreach (GameObject obj in initfalse) {
|
|
obj.SetActive(false);
|
|
}
|
|
|
|
foreach (GameObject obj in inittrue)
|
|
{
|
|
obj.SetActive(true);
|
|
}
|
|
one_active=0;
|
|
two_active=0;
|
|
three_active=0;
|
|
}
|
|
public void endArrange(int number) {
|
|
if (number == 1) {
|
|
if (one_active >= onenumber)
|
|
{
|
|
GameManager.Instance.setCurState(number);
|
|
}
|
|
else {
|
|
tip1.SetActive(true);
|
|
}
|
|
} else if (number==2) {
|
|
if (two_active >= twonumber)
|
|
{
|
|
GameManager.Instance.setCurState(number);
|
|
}
|
|
else
|
|
{
|
|
tip2.SetActive(true);
|
|
}
|
|
} else if (number==3) {
|
|
if (three_active >= threenumber)
|
|
{
|
|
GameManager.Instance.setCurState(number);
|
|
}
|
|
else
|
|
{
|
|
tip3.SetActive(true);
|
|
}
|
|
}
|
|
}
|
|
}
|