public void createExplosionCluster(Transform t, float xSize, float ySize) { GameObject newEC = Instantiate(explodeClusterPrefab, t); ExplosionCluster A = newEC.GetComponent <ExplosionCluster>(); A.setSize(xSize, ySize); }
void Explode() { ExplosionCluster exp = Instantiate(prefabExplosion, transform.position, Quaternion.identity) as ExplosionCluster; exp.count = 6; exp.delay = 0.0f; exp.interval = 0.05f; exp.radius = 1.0f; exp.damage = m_damage; exp.SetSpawner(m_spawner); Destroy(gameObject); }
void Start() { ui_hit = ui_hit_main.GetComponent <RectTransform>(); ui_bg = ui_hit_bg.GetComponent <RectTransform>(); ui_bg_width = Mathf.RoundToInt(ui_bg.rect.width); itemActualHealth = itemMaxHealth; boss_logic = boss.GetComponent <BossMercurial> (); ec = explosionCluster.GetComponent <ExplosionCluster> (); audioRef = gameObject.GetComponent <AudioSource> (); }
void OnTriggerEnter2D(Collider2D hit) { if ((hit.gameObject != m_spawner) && (!hit.gameObject.name.Equals("Laser(Clone)"))) { LifeManager manager = hit.gameObject.GetComponent <LifeManager>(); if (manager != null) { manager.DoDamage(m_damage, gameObject, m_spawner); } ExplosionCluster exp = Instantiate(prefabExp, transform.position + transform.up * 0.25f, Quaternion.identity) as ExplosionCluster; exp.count = 1; exp.damage = 0.0f; exp.minScale = 0.2f; exp.maxScale = 0.3f; exp.radius = 0.2f; exp.SetSpawner(m_spawner); Destroy(gameObject); } }
// Use this for initialization void Start() { ec = ExplosionObj.GetComponent <ExplosionCluster>(); Invoke("checkDead", 2f); }