Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class EntitySolider : soliderAI {
- private string name;
- private int maxHealth;
- private AIType aitype;
- private SoliderType soliderType;
- private int health;
- private soliderAI ai;
- public GameObject solider;
- public EntitySolider (string name, Vector3 pos) : base (aitype, solidertype) {
- this.name = name;
- generateRandomStats();
- ai = new soliderAI(aitype, soliderType);
- GameObject soliderPrefab = GameObject.Find("EntitySoliderPrefab");
- solider = GameObject.Instantiate(soliderPrefab, pos, soliderPrefab.transform.rotation);
- }
- void generateRandomStats() {
- int rnd = Random.Range(0, 1);
- if (rnd == 0) {
- this.aitype = AIType.FLAGS;
- } else {
- this.aitype = AIType.POINTS;
- }
- rnd = Random.Range(0, 1);
- if (rnd == 0) {
- this.soliderType = SoliderType.AGRESSIVE;
- } else {
- this.soliderType = SoliderType.OFFENSIVE;
- }
- this.maxHealth = 100 + Random.Range(-20, 20);
- }
- public GameObject getSoliderObject () {
- return solider;
- }
- }
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class soliderAI {
- private AIType aitype;
- private SoliderType soliderType;
- private int detectionRange = 5;
- public soliderAI (AIType aitype, SoliderType solidertype) {
- this.aitype = aitype;
- this.soliderType = solidertype;
- GlobalEvents.AIUpdateEvent += OnAIUpdate;
- }
- void OnAIUpdate (object sender, EventArgs e) {
- }
- void findNewPath () {
- switch (aitype) {
- case AIType.FLAGS:
- break;
- case AIType.POINTS:
- Collider[] hits = Physics.OverlapSphere(.transform.position, detectionRange);
- break;
- }
- }
- void targetNearestEnemie () {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment