// Use this for initialization void Start() { if (instance != null) { DestroyObject(this.gameObject); return; } instance = this; { var go = new GameObject("splash"); go.transform.position = new Vector3(-0.25f, 0.18f); this.sr_splash = go.AddComponent <SpriteRenderer>(); this.sr_splash.sprite = sprite_manager.instance.splash; this.sr_splash.sortingLayerName = "ui"; this.sr_splash.sortingOrder = 999; this.sr_splash.enabled = false; } { var go = new GameObject("menu"); go.transform.position = new Vector3(-0.25f, 0.18f); this.sr_menu = go.AddComponent <SpriteRenderer>(); this.sr_menu.sprite = sprite_manager.instance.menu; this.sr_menu.sortingLayerName = "ui"; this.sr_menu.sortingOrder = 1000; this.sr_menu.enabled = false; } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(this.gameObject); } DontDestroyOnLoad(this); options_menu.enabled = false; pause_menu.enabled = false; play.onClick.AddListener(Play); options.onClick.AddListener(Options); resume.onClick.AddListener(Resume); }