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;
        }
    }
Example #2
0
    // 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;
        }
    }