public GameObject CreateSoldier() { RespawnPoint_New point = SelectBestRespawnPointToCreateSoldier(); Vector3 pos = point.gameObject.transform.position; pos.y += 0.1f; Quaternion rot = point.gameObject.transform.rotation; currentSoldier = GameObject.Instantiate(soldierTypesToCreate[Random.Range(0, soldierTypesToCreate.Length)], pos, rot) as GameObject; currentSoldier.GetComponent <SoldierInfo>().Init(); charInfo = currentSoldier.GetComponent <CharacterInfo>(); if (RespawnPointType == RespawnPointTypeEnum.Counter) { counter--; if (counter == 0) { SetFinished(); } } SetDelayTimeCounter(); if (point.group != null) { point.group.StartDelay(point); } return(currentSoldier); }
public void AddRespawnPoint(RespawnPoint_New _rp) { if (!respawnPoints.Contains(_rp)) { respawnPoints.Add(_rp); } }
public void StartDelay(RespawnPoint_New _source) { for (int i = 0; i < respawnPoints.Count; i++) { if (respawnPoints[i] != _source) { respawnPoints[i].SetGroupDelay(Random.Range(delayTime_Min, delayTime_Max)); } } }