public void BossBulletClass(AnotherVec2 a_vcDir, float a_fSpeed, char c) { Random BbRandom = new Random(); int nBbPosX = BbRandom.Next(10, 65); if (BliPool.Count == 0) { BbMake(nMAKE_DEFAULT_COUNT); } BossBullet Bbullet = BbliPool[BbliPool.Count - 1]; BbliPool.RemoveAt(BbliPool.Count - 1); Bbullet.Init(4.0F, nBbPosX, 15, a_vcDir, a_fSpeed, c); BbliActive.Add(Bbullet); }
/// <summary> /// /// </summary> void attack2() { foreach (var item in m_dirsList) { Vector3 dir = item; GameObject go = Instantiate(m_cloneBullet); if (go != null) { go.transform.localPosition = transform.localPosition; BossBullet bullect = go.GetComponent <BossBullet>(); if (bullect != null) { bullect.Init(dir, 2f); } } } }
/// <summary> /// 向角色发起定向攻击 /// </summary> void attack1() { foreach (var item in LevelManager.Instance.AllPlayerList) { GameObject go = Instantiate(m_cloneBullet); if (go != null) { go.transform.localPosition = transform.localPosition; BossBullet bullect = go.GetComponent <BossBullet>(); if (bullect != null) { Actor target = item; Vector3 dir = target.transform.localPosition - transform.localPosition; bullect.Init(dir); } } } }