Exemplo n.º 1
0
    protected override void onTargetReached(GameObject obj)
    {
        TDWorld    world  = TDWorld.getWorld();
        GameObject player = world.getPlayer();

        if (obj == player)
        {
            return;
        }

        TDEnemy tdEnemy = world.getTDEnemy(obj);

        if (null != tdEnemy)
        {
            m_state = State.eFight;
            return;
        }

        if (world.isFakeTarget(obj))
        {
            DestroyObject(obj);
        }

        m_state = State.ePatrol;
    }
Exemplo n.º 2
0
 protected override void setTarget(GameObject newTarget)
 {
     if (null != target())
     {
         TDWorld world = TDWorld.getWorld();
         if (world.isFakeTarget(target()))
         {
             DestroyObject(target());
         }
     }
     base.setTarget(newTarget);
 }