示例#1
0
    protected void OnTriggerEnter(Collider other)
    {
        Locality newHome = other.GetComponent <Locality>();

        if (home == newHome && state != UnitState.Back)
        {
            return;
        }
        if (newHome != null && newHome.CanJoin(this))
        {
            newHome.JoinUnit(this);
        }
    }