private void Awake() { if (instance != null) { Destroy(gameObject); return; } instance = this; }
private void Start() { transferUI = gameObject.GetComponentInChildrenWithTag <UITransfer>("UI"); if (transferUI == null) { Debug.LogWarning("No TransferUI found !"); } if (items != null && Items.Length == 0) // don't fill with debug items if data already loaded { foreach (var i in items) { AddItem((GameObject.Instantiate(i, Vector3.zero, Quaternion.identity) as GameObject).GetComponent <IItem>()); } } if (shouldRegister) { ContainersManager.RegisterContainer(this); } }
private void OnDestroy() { instance = null; }