Exemplo n.º 1
0
 /// <summary>
 /// Updates the dynamic AI numbers.(needs testing, note : add it after character death?, needs to be network synced?)
 /// </summary>
 public static void UpdateDynamicAINumbers()
 {
     _dynamicAINumbers.Clear();
     foreach (PhotonView p in AIStatusHandler.Get_ALL_PVs(true))
     {
         if (p.GetComponent <UnitComponent> () == null)
         {
             Debug.LogWarning("WARNING : AIStatusHandler without UnitComponent");
             continue;
         }
         else
         {
             _dynamicAINumbers.Add((DynamicAINumber)p.GetComponent <UnitComponent> ().attributes.value);
         }
     }
 }
Exemplo n.º 2
0
    ///
    /// <summary>
    /// Gets the list of enemies searched from photonview list
    /// </summary>
    /// <returns>The enemies.</returns>
    /// <param name="ofTeam">Of team.</param>
    /// <param name="checkAlive">If set to <c>true</c> check alive.</param>
    public static List <CombatHandler> GET_ENEMIES(TEAM ofTeam, bool checkAlive = false)
    {
        List <CombatHandler> enemies = new List <CombatHandler> ();

        foreach (var p in AIStatusHandler.Get_ALL_PVs(checkAlive))
        {
            CombatHandler ch = p.GetComponent <CombatHandler> ();
            if (ch != null)
            {
                //check if enemy
                if (ofTeam != ch.GetTeam())
                {
                    enemies.Add(ch);
                }
            }
            else
            {
                Debug.LogWarning("WARNING : this photonview must have combathandler as its component");
            }
        }
        return(enemies);
    }