﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace Tap.Tilt
{


    public class AnimatorOnEnable : MonoBehaviour
    {
        public Animator animator;

        public string param = "spawn";
        public AnimatorControllerParameterType paramType = AnimatorControllerParameterType.Trigger;

        private void OnEnable()
        {
            switch (paramType)
            {
                case AnimatorControllerParameterType.Trigger:
                    animator.SetTrigger(param);
                    break;
                case AnimatorControllerParameterType.Bool:
                    animator.SetBool(param, true);
                    break;
                case AnimatorControllerParameterType.Float:
                    animator.SetFloat(param, 1f);
                    break;
                case AnimatorControllerParameterType.Int:
                    animator.SetInteger(param, 1);
                    break;
            }
        }
    }
}
