using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace TallGuy
{
    public class TileHandler : MonoBehaviour
    {
        public Material fiah, watah;
        public new Renderer renderer;

        public void Awake()
        {
            renderer.enabled = false;
        }
        
        [SerializeField]
        private State state;

        public void SetState(State state)
        {
            if (this.state == state)
                return;

            switch (state)
            {
                case State.Land:
                    renderer.enabled = false;
                    break;
                case State.Fiah:
                    renderer.material = fiah;
                    renderer.enabled = true;
                    break;
                case State.Watah:
                    renderer.material = watah;
                    renderer.enabled = true;
                    break;
            }

            this.state = state;
        }
        public enum State { Land, Fiah, Watah }
    }
}