using OnlineMaps;
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
    [ActionCategory(OnlineMapsCategories.DRAWING)]
    [Tooltip("Remove all drawing elements from map.")]
    public class RemoveAllDrawingElements : FsmStateAction
    {
        public override void Reset()
        {
            
        }

        public override void OnEnter()
        {
            DoEnter();
            Finish();
        }

        private void DoEnter()
        {
            if (!Map.instance)
            {
                Debug.LogError("Online Maps not found.");
                return;
            }

            DrawingElementManager.RemoveAllItems();
        }
    }
}