61 lines
1.2 KiB
C#
61 lines
1.2 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
|
||
public class Anilottery : MonoBehaviour
|
||
{
|
||
public GameObject YelloBox;
|
||
public Animator YelloAni;
|
||
|
||
public GameObject PurpleBox;
|
||
public Animator PurpleAni;
|
||
|
||
public GameObject RewardPanel;
|
||
// Start is called before the first frame update
|
||
void Start()
|
||
{
|
||
RewardPanel.SetActive(false);
|
||
}
|
||
public void ShowReward()
|
||
{
|
||
RewardPanel.SetActive(true);
|
||
}
|
||
public void OpenBox(int id )//0是黄,1是紫
|
||
{
|
||
if (id == 0)
|
||
{
|
||
PurpleBox.SetActive(false);
|
||
YelloBox.SetActive(true);
|
||
|
||
}
|
||
else
|
||
{
|
||
YelloBox.SetActive(false);
|
||
PurpleBox.SetActive(true);
|
||
|
||
}
|
||
}
|
||
|
||
public void OpenB(int id)//0是黄,1是紫
|
||
{
|
||
if (id == 0)
|
||
{
|
||
|
||
YelloAni.SetBool("IsOpen", true);
|
||
|
||
}
|
||
else
|
||
{
|
||
|
||
PurpleAni.SetBool("IsOpen", true);
|
||
|
||
}
|
||
|
||
}
|
||
public void ReturnState()//恢复动画状态
|
||
{
|
||
YelloAni.SetBool("IsOpen", false);
|
||
PurpleAni.SetBool("IsOpen", false);
|
||
}
|
||
}
|