Ejemplo n.º 1
0
    public void OnTargetSelect(Actor actor)
    {
        UIManager.Instance.BattleCharInfoPanel.SetTarget(actor);

        foreach (TargetingCircle circle in targetingCirclesInUse)
        {
            circle.transform.SetParent(null);
            circle.gameObject.SetActive(false);
            targetingCirclesAvailable.Enqueue(circle);
        }

        targetingCirclesInUse.Clear();

        if (actor != null)
        {
            int i = 0;
            foreach (ActorAbility ability in actor.GetInstancedAbilities())
            {
                if (ability.abilityBase.abilityType == AbilityType.SELF_BUFF)
                {
                    continue;
                }
                TargetingCircle circle = targetingCirclesAvailable.Dequeue();
                targetingCirclesInUse.Add(circle);
                circle.SetScale(ability.TargetRange * 2 / actor.transform.localScale.x);
                circle.gameObject.SetActive(true);
                circle.transform.SetParent(actor.transform, false);
                circle.transform.localPosition = Vector3.zero;
                circle.transform.eulerAngles   = new Vector3(0, 0, i * 53);
                circle.SetText(ability.abilityBase.LocalizedName);

                switch (i)
                {
                case 0:
                    circle.SetColor(new Color(0.7f, 1f, 1f));
                    break;

                case 1:
                    circle.SetColor(new Color(1f, 0.7f, 1f));
                    break;

                case 2:
                    circle.SetColor(new Color(1f, 1f, 0.7f));
                    break;

                case 3:
                    circle.SetColor(new Color(1f, 1f, 1f));
                    break;

                default:
                    break;
                }

                i++;
            }
        }
    }
Ejemplo n.º 2
0
    public void ResetManager()
    {
        IsMovementMode   = false;
        IsSummoningMode  = false;
        selectedHero     = null;
        onSummonCallback = null;

        targetingCirclesAvailable.Clear();
        targetingCirclesInUse.Clear();

        for (int i = 0; i < 4; i++)
        {
            TargetingCircle circle = Instantiate(ResourceManager.Instance.TargetingCirclePrefab);
            circle.gameObject.SetActive(false);
            targetingCirclesAvailable.Enqueue(circle);
        }
    }