private void Start() { gameObject.layer = LayerMask.NameToLayer("Interactable"); if (!VariablePersister.Exist(key)) { return; } isOpen = VariablePersister.GetBool(key); if (isOpen) { SpriteRenderer spriteRenderer = GetComponent <SpriteRenderer>(); spriteRenderer.sprite = enptyImage; } }
// Start is called before the first frame update void Start() { gameObject.layer = LayerMask.NameToLayer("Interactable"); triggerColider = GetComponent <Collider2D>(); if (!VariablePersister.Exist(key)) { return; } isOpen = VariablePersister.GetBool(key); if (isOpen) { door.SetActive(false); triggerColider.enabled = false; } }