-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpawnBoss.cs
26 lines (21 loc) · 946 Bytes
/
SpawnBoss.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using UnityEngine;
public class SpawnBoss : MonoBehaviour
{
public GameObject eni1;
public float bossDmgGetHarderBy;
public float bossSpeedGetHarderBy;
public float bossHealthGetHarderBy;
public void Spawn()
{
var transform1 = transform;
var spawn = Instantiate(eni1, transform1.position, transform1.rotation);
var spawnEni = spawn.GetComponent<eni.eni>();
spawnEni.health = (int) (spawnEni.health * bossHealthGetHarderBy);
spawnEni.MoveSpeed = (int) (spawnEni.MoveSpeed * bossSpeedGetHarderBy);
spawnEni.ZombieDmg = (int) (spawnEni.ZombieDmg * bossDmgGetHarderBy);
var scale = spawn.gameObject.transform.localScale;
spawn.gameObject.transform.localScale = new Vector3(scale.x * 2, scale.y * 2, scale.z * 2);
//var box = spawn.gameObject.GetComponent<BoxCollider2D>();
//box.size = new Vector2(box.size.x * 2, box.size.y * 2);
}
}