Esempio n. 1
0
 protected override void Awake()
 {
     base.Awake();
     sight        = GetComponent <EnemySight> ();
     weaponSystem = GetComponent <EnemyWeaponSystem> ();
     distraction  = GetComponent <EnemyDistraction>();
     plane        = GetComponent <EnemySightPlane> ();
     player       = GameObject.FindGameObjectWithTag("Player");
 }
Esempio n. 2
0
    protected override void Awake()
    {
        base.Awake();
        GameObject parent = (transform.parent != null) ? transform.parent.gameObject : null;
        GameObject temp   = Instantiate(symbolObject, transform.position + new Vector3(0.0f, 1.25f, 0.0f), Quaternion.identity);

        if (temp)
        {
            symbol        = temp.GetComponent <Symbol>();
            symbol.Target = gameObject;
        }
        sight          = (parent != null) ? parent.GetComponentInChildren <EnemySight> () : GetComponent <EnemySight>();
        movement       = (parent != null) ? parent.GetComponentInChildren <EnemyMovement>() : GetComponent <EnemyMovement>();;
        weaponSystem   = (parent != null) ? parent.GetComponentInChildren <EnemyWeaponSystem>() : GetComponent <EnemyWeaponSystem>();
        distraction    = (parent != null) ? parent.GetComponentInChildren <EnemyDistraction>() : GetComponent <EnemyDistraction>();
        plane          = (parent != null) ? parent.GetComponentInChildren <EnemySightPlane>() : GetComponent <EnemySightPlane>();
        renderer       = GetComponent <MeshRenderer>();
        player         = GameObject.FindGameObjectWithTag("Player");
        playerMovement = player.GetComponent <PlayerMovement>();
        reporter       = GetComponent <KillReporter>();
    }