| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Enemy : MonoBehaviour
- {
- private float power;
- private enum PowerLevels { VeryLow, Low, Medium, High, Full}
- [SerializeField]
- private PowerLevels powerLevel;
- private EnemyAI.BehaviorController behaviorController;
- void OnCollisionEnter(Collision collision)
- {
- Debug.Log("hlk" + collision.collider.tag);
- if (collision.collider.tag == "Bullet")
- {
- Death();
- }
- }
- // Use this for initialization
- void Start ()
- {
- behaviorController = new EnemyAI.BehaviorController();
- behaviorController.blackboard.navMeshAgent = GetComponent<UnityEngine.AI.NavMeshAgent>();
- }
-
- // Update is called once per frame
- void Update ()
- {
- EnemyAI.Blackboard blackboard = behaviorController.blackboard;
- // TODO get state
- blackboard.Night = true;
- // TODO get position
- blackboard.PlayerPosition = GameObject.FindGameObjectWithTag("Player").transform.position;
- blackboard.EnemyPosition = transform.position;
- behaviorController.Update();
- }
- private void Death()
- {
- GameObject.Destroy(gameObject);
- }
- }
|