Beispiel #1
0
    public void ForcePush(int dir)
    {
        if (entity == null)
        {
            return;
        }

        if (entity.tag == "Enemy")
        {
            BasicEnemyAI enemyAI = entity.GetComponent <BasicEnemyAI>();
            enemyAI.IsStunned = true;
            if (enemyAI.gridCell.cellNeighbours[dir] != null && enemyAI.gridCell.cellNeighbours[dir].entity == null)
            {
                //enemyAI.gridCell.cellNeighbours[dir].ForcePush(dir);
                enemyAI.IsStunned = true;
                Walkable          = true;
                entity            = null;
                enemyAI.gridCell  = enemyAI.gridCell.cellNeighbours[dir];
            }
            else
            {
                enemyAI.Die(VisualInfo.deathExpansionRatio);//h
            }
        }
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     aiController = this.GetComponentInParent <BasicEnemyAI>();
 }
Beispiel #3
0
    BasicEnemyAI enemy;                                         //	Reference to enemy

    /*--------------------------------------------------------------------------------------*/
    /*																						*/
    /*	Start: Runs once at the begining of the game. Initalizes variables.					*/
    /*																						*/
    /*--------------------------------------------------------------------------------------*/
    void Start()
    {
        enemy = GetComponentInChildren <BasicEnemyAI> ();
    }
 // Use this for initialization
 void Start()
 {
     ai = gameObject.GetComponentInParent <BasicEnemyAI> ();
 }