Exemple #1
0
 // Use this for initialization
 void Start()
 {
     targetSlot = GameManager.Instance.gameBoard.GetSlot(command.x, command.y);
     crosshairs.SetColor(crossHairColor, 0.75f);
     transform.position    = new Vector3(0, 100, 0);
     transform.localScale  = new Vector3(15, 15, 15);
     transform.eulerAngles = new Vector3(15, 90, 0);
     lerperTransform       = GetComponent <LerpTransform>();
     lerperTransform.SetTransform(targetSlot.transform, 1f);
 }
Exemple #2
0
    protected void Update()
    {
        if (EntityView != null)
        {
            if (attackText != null)
            {
                if (EntityView.GetAttack() > 0)
                {
                    attackText.text = EntityView.GetAttack().ToString();
                    attackIcon.gameObject.SetActive(true);
                }
                else
                {
                    attackIcon.gameObject.SetActive(false);
                }
            }
            if (healthText != null)
            {
                healthText.text = EntityView.GetHealth().ToString();
            }

            if (shieldIcon != null)
            {
                if (EntityView.GetMaxShields() > 0)
                {
                    shieldIcon.gameObject.SetActive(true);
                }
                else
                {
                    shieldIcon.gameObject.SetActive(false);
                }
            }
            if (ownerTint != null)
            {
                if (IsFriendly)
                {
                    ownerTint.SetColor(friendlyColor, 0.5f);
                }
                else
                {
                    ownerTint.SetColor(enemyColor, 0.5f);
                }
            }

            if (shieldText != null)
            {
                shieldText.text = EntityView.GetShields().ToString();
            }
            if (shields != null)
            {
                shields.Strength = EntityView.GetShields();
            }
        }
    }
Exemple #3
0
 void Start()
 {
     shields1.SetColor(Color.clear, 0);
     shields2.SetColor(Color.clear, 0);
     _flashRenderer = shieldFlash.GetComponent <Renderer>();
     if (shieldPeakValue < 1)
     {
         shieldPeakValue = 1;
     }
     timer = 9999;
 }
Exemple #4
0
    override protected void Start()
    {
        base.Start();

        glowTint.SetColor(Color.black, 0);
    }
Exemple #5
0
    void Update()
    {
        // If there's a selected entity and this is a valid slot for the entity to play on, light up:
        bool  isSelectionFocus = false;
        bool  isValidTarget    = false;
        bool  isValidDiscard   = false;
        Color glowColor        = neutralIdle;
        Color strokeColor      = neutralStroke;

        if (UIManager.Instance.Selected)
        {
            isValidTarget  = CommandManager.Instance.IsValidPlay(UIManager.Instance.Selected, this);
            isValidDiscard = CommandManager.Instance.IsValidDiscard(UIManager.Instance.Selected, this);
            if (UIManager.Instance.SlotTarget == this)
            {
                isSelectionFocus = true;
            }
        }
        if (isValidDiscard)
        {
            strokeColor = discardStroke;
            if (isSelectionFocus)
            {
                glowColor = discardFocus;
            }
            else
            {
                glowColor = discardValid;
            }
        }
        else if (Unit && Unit.IsFriendly)
        {
            strokeColor = friendlyStroke;
            if (isSelectionFocus)
            {
                glowColor = friendlyFocus;
            }
            else if (isValidTarget)
            {
                glowColor = friendlyValid;
            }
            else
            {
                glowColor = friendlyIdle;
            }
        }
        else if (Unit && Unit.IsEnemy)
        {
            strokeColor = enemyStroke;
            if (isSelectionFocus)
            {
                glowColor = enemyFocus;
            }
            else if (isValidTarget)
            {
                glowColor = enemyValid;
            }
            else
            {
                glowColor = enemyIdle;
            }
        }
        else
        {
            if (isSelectionFocus)
            {
                glowColor = neutralFocus;
            }
            else if (isValidTarget)
            {
                glowColor = neutralValid;
            }
            else
            {
                glowColor = neutralIdle;
            }
        }
        if (!UIManager.Instance.Selected && Unit != null && Unit.HasValidActions)
        {
            Color c = Color.Lerp(glowColor, actionsRemaining, UIManager.Instance.PingPong);
            glowLerp.SetColor(c, 0f);
            strokeLerp.SetColor(strokeColor, 0f);
        }
        else
        {
            glowLerp.SetColor(glowColor, duration);
            strokeLerp.SetColor(strokeColor, duration);
        }
        if (GameManager.Instance.gameBoard.showCoordinates)
        {
            debugText.gameObject.SetActive(true);
        }
        else
        {
            debugText.gameObject.SetActive(false);
        }
    }
Exemple #6
0
 void Start()
 {
     glowLerp.SetColor(Color.clear, 0);
     debugText.text = (x + "," + y);
 }
Exemple #7
0
 void Start()
 {
     boardTint.SetColor(Color.clear, 0);
 }