Exemple #1
0
    void OnTriggerExit(Collider collider)
    {
        if (collider.GetComponent <Unit>() && !collider.GetComponent <Collectable>() &&
            !collider.GetComponent <Unit>().faction.Equals(this.GetComponentInParent <Unit>().faction))
        {
            NearsRTSGameObjects.Remove(collider.GetComponent <Unit>());
        }

        if (collider.GetComponent <WalkingUnit>() &&
            collider.GetComponent <WalkingUnit>().faction.Equals(this.GetComponentInParent <WalkingUnit>().faction))
        {
            NearFriendliesUnit.Remove(collider.GetComponent <WalkingUnit>());
        }
    }