_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/GLScripts/Anilottery.cs
2024-12-13 10:02:21 +08:00

61 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}
}