private void OnDestroy() { if (instance == this) { m_instance = null; } }
private void Awake() { if (!groundhogDay) { groundhogDay = FindObjectOfType <GroundhogDay>(); } Debug.Assert(groundhogDay, "groundhogDay is null", this); }
private void Awake() { interactable = GetComponent <KeyCardReader>(); if (!groundhogDay) { groundhogDay = FindObjectOfType <GroundhogDay>(); } Debug.Assert(groundhogDay, "groundhogDay is null", this); interactable.interactEventComponent.onInteract.AddListener(OnInteract); }
private void Awake() { if (!groundhogDay) { groundhogDay = FindObjectOfType <GroundhogDay>(); } Debug.Assert(groundhogDay, "groundhogDay is null", this); if (!player) { player = FindObjectOfType <PlayerController>(); } Debug.Assert(player, "player is null", this); }
public void GroundhogDayYearTest(int year) { GroundhogDay holiday = new GroundhogDay(); Assert.AreEqual(year, holiday.GetByYear(year).Year); }