public void OnDestroy() { //free up the main ref if this was main if (main == this) { main = null; } }
public void Awake() { //set this as main if no main exists if (main == null) { main = this; } levelHeaderGroup = GetComponent <CanvasGroup>(); //set to default state SetHeaderState(HeaderState.INACTIVE); }
private void finishSceneSetup() { GameManager.GetPlayer().GetComponent <Player> ().tetherAnchorEnded -= finishSceneSetup; GameManager.inst.ExitPauseState(); //start up header display LevelNameHeader lnh = LevelNameHeader.getMain(); if (lnh != null) { if (SceneSetup.inst == null || SceneSetup.inst.useLevelHeader) { LevelNameHeader.getMain().SetHeaderState(LevelNameHeader.HeaderState.WAIT_TO_APPEAR); } } else { Debug.LogWarning("No main LevelNameHeader!"); } Debug.Log("[TransitionBuddy] All done setting up. Have fun!"); }