Beispiel #1
0
    //Es virtual para el decoy del mago.
    protected override void OnMouseEnter()
    {
        if (LM.currentLevelState == LevelManager.LevelState.ProcessingPlayerActions)
        {
            if (LM.selectedEnemy == null)
            {
                if (LM.selectedCharacter != null && LM.selectedCharacter == myMage && !myMage.hasMoved)
                {
                    ShowInterchangeEffect();

                    Debug.Log("intercambio");

                    //Intercambio con decoy
                }

                else if (LM.selectedCharacter != null && LM.selectedCharacter.currentUnitsAvailableToAttack.Contains(this.GetComponent <UnitBase>()))
                {
                    //Atacar al decoy
                    LM.CalculatePreviousActionPlayer(LM.selectedCharacter, this);
                    Cursor.SetCursor(LM.UIM.attackCursor, Vector2.zero, CursorMode.Auto);

                    Debug.Log("attackCursor");

                    if (myMage.isDecoyBomb)
                    {
                        ShowBombAttackEffect();
                    }
                }

                //Hover sobre el decoy para seleccionarlo
                else
                {
                    Debug.Log("selecssion");

                    if (!hasAttacked)
                    {
                        LM.ShowUnitHover(movementUds, this);
                    }
                }
            }
        }
    }