Exemplo n.º 1
0
 public virtual void CommitDeed(string tag)
 {
     if (currentTarget == null)
     {
         return;
     }
     m_deedReporter.ReportDeed(tag, currentTarget.factionMember);
 }
Exemplo n.º 2
0
        private void OnCollisionEnter2D(Collision2D coll)
        {
            var otherMember = coll.collider.GetComponentInChildren <FactionMember>();

            if (otherMember == null || !aggressive)
            {
                return;
            }
            if (m_member.GetAffinity(otherMember) < 0)
            {
                if (m_deedReporter != null)
                {
                    m_deedReporter.ReportDeed("attack", otherMember);
                }
                if (!string.Equals(otherMember.faction.name, "Farmer"))
                {
                    Destroy(otherMember.gameObject);
                    HandleTarget(null);
                    m_inRange.RemoveAll(x => x == null);
                    CheckForNewTarget();
                }
            }
        }