Beispiel #1
0
 private void CheckForNonBasicTypes()
 {
     foreach (GameObject icon in IconsToDelete)
     {
         Destroy(icon);
     }
     CheckForSpecial();
     CheckForConstruct();
     CheckForSummonned();
     CheckForColossus();
     CheckForUndead();
     CheckForPoisonous();
     CheckForFlying();
     CheckForShortRange();
     CheckForCannotAttack();
     CheckForStopRetaliation();
     CheckForNoMeleePen();
     CheckForAssassin();
     if (ManagementScene)
     {
         foreach (PassiveAbility ability in myUnit.GetComponents <PassiveAbility>())
         {
             if (ability is BasicStatModifier || ability.HasIcon == false)
             {
                 continue;
             }
             GameObject icon = shower.AddAbilityIcon((GameObject)Resources.Load(ability.AbilityIconName), false);
             IconsToDelete.Add(icon);
         }
     }
 }
Beispiel #2
0
    public void Update()
    {
        if (AbilityIcon == null)
        {
            //Debug.Log(name);
        }
        ChangableUpdate();
        if (myUnit == MouseManager.Instance.SelectedUnit && wasSelectedLastTimeWeChecked == false && HasIcon)
        {
            // so we are selected, but didnt tell it to ourselves yet
            IconForReal = RealTooltip.AddAbilityIcon(AbilityIcon, true);
            wasSelectedLastTimeWeChecked = true;
        }
        if (myUnit != MouseManager.Instance.SelectedUnit && wasSelectedLastTimeWeChecked)
        {
            if (Application.isEditor)
            {
                DestroyImmediate(IconForReal);
            }
            else
            {
                Destroy(IconForReal);
            }
            wasSelectedLastTimeWeChecked = false;
        }


        if (EnemyTooltipHandler.isOn && UnrealTooltip.Unit == myUnit && wasHighlightedLastTimeWeChecked == false && HasIcon)
        {
            IconForUnreal = UnrealTooltip.AddAbilityIcon(AbilityIcon, false);
            wasHighlightedLastTimeWeChecked = true;
        }
        if ((EnemyTooltipHandler.isOn == false || UnrealTooltip.Unit != myUnit) && wasHighlightedLastTimeWeChecked == true)
        {
            wasHighlightedLastTimeWeChecked = false;
            if (Application.isEditor)
            {
                DestroyImmediate(IconForUnreal);
            }
            else
            {
                Destroy(IconForUnreal);
            }
        }
    }