ClientServer/Client/Assets/Scripts/Util/EnableOnChristmas.cs

25 lines
475 B
C#
Raw Normal View History

2025-09-06 17:17:39 +04:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnableOnChristmas : MonoBehaviour
{
// Start is called before the first frame update
private void Awake()
{
//get the date
System.DateTime date = System.DateTime.Now;
//check if it's Christmas
if (date.Month == 12 && date.Day == 25)
{
//enable the object
gameObject.SetActive(true);
}
else
{
//disable the object
gameObject.SetActive(false);
}
}
}