37 lines
742 B
C#
37 lines
742 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class moon : MonoBehaviour
|
|
{
|
|
private Animator anim;
|
|
private bool moonStatus = false;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
anim = GetComponent<Animator>();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void toggleMoon()
|
|
{
|
|
if (moonStatus == false)
|
|
{
|
|
anim.SetBool("Moonrise",true);
|
|
moonStatus = true;
|
|
Debug.Log("Moon up!");
|
|
}
|
|
else
|
|
{
|
|
anim.SetBool("Moonrise",false);
|
|
moonStatus = false;
|
|
Debug.Log("Moon down!");
|
|
}
|
|
}
|
|
}
|