Exemple #1
0
    public bool activateHighLight(HighLightManager.EHighLightType type, HighLightManager.EHighLightStatus status)
    {
        int index = suscribedTypes.IndexOf(type);

        previousScale = transform.localScale;

        if (index < 0)
        {
            if (suscribedTypes.Count == 0)
            {
                gameObject.SetActive(true);

                if (hasBeat)
                {
                    Invoke("highLightBeat", 2);
                }
            }

            suscribedTypes.Add(type);
            suscribedStatus.Add(status);

            updateColor();

            if (!lastForever)
            {
                initAnim();
            }

            return(true);
        }
        return(false);
    }
Exemple #2
0
    public bool deactivateType(HighLightManager.EHighLightType type)
    {
        int index = suscribedTypes.IndexOf(type);

        if (index >= 0)
        {
            suscribedTypes.RemoveAt(index);
            suscribedStatus.RemoveAt(index);

            if (suscribedTypes.Count == 0)
            {
                gameObject.SetActive(false);

                //HACK revisar

                /*
                 * if (particles != null)
                 * {
                 *      particles.Clear();
                 *      particles.Stop ();
                 *      //borderStars.SetActive (false);
                 * }*/

                finishAnim();

                if (hasBeat)
                {
                    transform.localScale = previousScale;
                    DOTween.Kill("HighLightBeat", true);
                }

                return(true);
            }
            else
            {
                updateColor();
                return(false);
            }
        }
        return(false);
    }