예제 #1
0
		public override void OnSpawn()
		{
			base.OnSpawn();
			
			if (RightHand is ProjectileWeapon)
				_brain = new RangedAI(this);
			else
				_brain = new CombatAI(this);
		}
예제 #2
0
    private void Awake()
    {
        ai               = GetComponent <RangedAI>();
        Target           = ai.target;
        MaxHealth        = health;
        enemyRenderer    = GetComponentInChildren <Renderer>();
        originalMaterial = enemyRenderer.material;

        attackTimer        = timeBetweenAttacks * 0.5f;
        TimeBetweenAttacks = timeBetweenAttacks;
        EnemyAudioSource   = GetComponent <AudioSource>();
        GamesManager       = GameObject.FindWithTag("GameManagement").GetComponent <GameManagement>();
    }
예제 #3
0
        /// <inheritdoc/>
        public override void OnSpawn()
        {
            base.OnSpawn();

            if (_brain != null)
            {
                return;
            }

            if (RightHand is ProjectileWeapon)
            {
                _brain = new RangedAI(this);
            }
            else
            {
                _brain = new CombatAI(this);
            }
        }
예제 #4
0
 public void Release()
 {
     owner = null;
 }
예제 #5
0
 public void Claim(RangedAI ai)
 {
     owner = ai;
 }