using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class EnemyManager : MonoBehaviour
{
public GameObject shark; // prefab von Shark
public GameObject instanceShark; // globale Instanzvariable von Shark
public Transform[] spawnPoints; // An array of the spawn points this enemy can spawn from.
public float spawnTime = 3f; // How long between each spawn.
public int maximumSharks = 2;
private int currentSharks;
public int healthShark; // current Health von Shark
public int startinghealthShark = 200;
public float sinkSpeed = 2.5f;
bool isDead;
void Start ()
{
healthShark = startinghealthShark;
currentSharks = 0;
}
void Update ()
{
if (currentSharks
Подробнее здесь: [url]https://stackoverflow.com/questions/31676866/unity-enemy-spawn-health-system[/url]
Я работаю над системой появления врагов. Это мой код: [code]using UnityEngine; using System.Collections; using System.Collections.Generic;
public class EnemyManager : MonoBehaviour { public GameObject shark; // prefab von Shark public GameObject instanceShark; // globale Instanzvariable von Shark public Transform[] spawnPoints; // An array of the spawn points this enemy can spawn from. public float spawnTime = 3f; // How long between each spawn. public int maximumSharks = 2; private int currentSharks; public int healthShark; // current Health von Shark public int startinghealthShark = 200; public float sinkSpeed = 2.5f; bool isDead;