// y -100,100 // x 300, 150 private void Awake() { m_Move = gameObject.GetComponent <EnemyActHelper>(); m_Shot = gameObject.GetComponent <BulletShotHelper>(); playerTrasform = GameObject.FindGameObjectWithTag("playerMesh").transform; }
private IEnumerator SkillShip_2(GameObject obj, float shotTime) { BulletShotHelper m_shot = obj.GetComponent <BulletShotHelper>(); int index = m_shot.StartMoreRotationLines(bullet, bullets, 12, 20, 50, 0.1f); yield return(new WaitForSeconds(shotTime)); m_shot.StopCoroutineWithIndex(index); }
private void Start() { m_Transform = gameObject.transform; pos = m_Transform.position + new Vector3(100, 0, 0); m_shot = gameObject.GetComponent <BulletShotHelper>(); bullet = Resources.Load <GameObject>("Bullet/Bullet_Player_1"); bullets = GameObject.Find("BulletParent"); StartCoroutine(Haviour()); }
//-----------------------------------射击相关函数----------------------------------------------- // 初始化射击相关变量 private void InitShot() { index = JsonPlayerData.Instance.GetDataIndex(); m_Shot = gameObject.GetComponent <BulletShotHelper>(); bullets = GameObject.Find("BulletParent"); bullet = Resources.Load <GameObject>("Bullet/Bullet_Player_" + index); shotNumber = 1; shotSpeed = 500; shotRange = 10f; waitSeconds = 0.1f; eulerAngle = 0; stopShot = false; shotDefault = true; DefaultShot(); }
/// <summary> /// 初始化各种成员 /// </summary> private void Init() { baseSpeed = GameData.Instance.Speed; baseNumber = GameData.Instance.BulletNumber; bullets = GameObject.Find("BulletParent"); bullet_Big = Resources.Load<GameObject>("Bullet/Bullet_Cycle_Big"); bullet_Common = Resources.Load<GameObject>("Bullet/Bullet_Cycle_Common"); player_Transform = GameObject.FindWithTag("playerMesh").transform; m_Shot = gameObject.GetComponent<BulletShotHelper>(); m_Move = gameObject.GetComponent<EnemyActHelper>(); m_Transform = gameObject.transform; m_Transform.position = new Vector3(300, 0.0f, 260); m_Transform.rotation = Quaternion.Euler(new Vector3(0.0f, -90f, 90f)); StartCoroutine("StartAct"); }
private IEnumerator SkillShip_4(GameObject obj, float shotTime) { BulletShotHelper m_shot = obj.GetComponent <BulletShotHelper>(); ShipControl m_ShipControl = obj.GetComponent <ShipControl>(); m_ShipControl.NotDieStateStart(); int index = m_shot.StartCycleBoom(bullet, bullet, bullets, 12, 12, 100, 60, 0.1f, 0.5f); int index_2 = m_shot.StartRotationLines(bullet_other, bullets, 12, 10, 100, 0.1f); yield return(new WaitForSeconds(shotTime)); m_shot.StopCoroutineWithIndex(index); m_shot.StopCoroutineWithIndex(index_2); if (PlayerPrefs.GetInt("NotDie") == 0) { m_ShipControl.NotDieStateEnd(); } }
private IEnumerator SkillShip_3(GameObject obj, float shotTime) { BulletShotHelper m_shot = obj.GetComponent <BulletShotHelper>(); ShipControl m_ShipControl = obj.GetComponent <ShipControl>(); m_ShipControl.NotDieStateStart(); int index = m_shot.StartCycleLines(bullet, bullets, 12, 10, false, 80, 0.1f); //m_shot.StartMoreLineWithTimeOffsetAndTrace(bullet, bullets, new Vector3(50, 0, 260), 3, 20, 30, 50, 0.1f, 0.5f); //int index = m_shot.StartCycleLinesWithTimeOffsetAndTrace(bullet, bullets, new Vector3(50, 0, 260f), // 38, 10, false, 30, 100, 0.1f, 1.0f); yield return(new WaitForSeconds(shotTime)); m_shot.StopCoroutineWithIndex(index); if (PlayerPrefs.GetInt("NotDie") == 0) { m_ShipControl.NotDieStateEnd(); } }