//deactivate the current spell
 public void DeactivateIndicator()
 {
     spellIndicatorType = SpellIndicatorType.OFF;
     //disable the indicator sprite object
     indicator.SetActive(false);
     indicator.transform.position = gameObject.transform.position;
 }
    // Start is called before the first frame update
    void Start()
    {
        indicatorSprite = GameObject.Find("indicator Sprite");
        //get the sprite renderer
        m_spriteRenderer = indicatorSprite.GetComponent <SpriteRenderer>();

        indicator.SetActive(false);

        //inital new mouse plane at y=0;
        plane = new Plane(Vector3.up, 0.0f);

        //init spell indicator type
        spellIndicatorType = SpellIndicatorType.OFF;
    }
    public void IndicatorToggle(SpellIndicatorType type)
    {
        if (spellIndicatorType == type)
        {
            DeactivateIndicator();
            return;
        }
        spellIndicatorType = type;
        //set the sprite
        m_spriteRenderer.sprite = indicatorTypes[(int)type].indicatorSprite;
        //set the color
        m_spriteRenderer.color = indicatorTypes[(int)type].indicatorColor;
        //set indicator scale based on the max distance
        indicator.transform.localScale = new Vector3(indicatorTypes[(int)type].maxDistanceFromBody, indicatorTypes[(int)type].maxDistanceFromBody, indicatorTypes[(int)type].maxDistanceFromBody);
        //reset position to self in case spell was cancel
        indicator.transform.position = gameObject.transform.position;

        //enable the indicator sprite object
        indicator.SetActive(true);
    }