public void Explosion(Vector3 point, Quaternion rot, bool myself) { if (bUse) { colPoint = point; if (!bBoom && expolsion != null) { GameObject gameObject = Object.Instantiate((Object)expolsion, point, rot) as GameObject; CheckBrickDead component = gameObject.GetComponent <CheckBrickDead>(); if (component != null) { component.brickID = idBrick; } CheckMonDead component2 = gameObject.GetComponent <CheckMonDead>(); if (component2 != null) { component2.MonID = idMon; } if (myself) { ParentFollow component3 = gameObject.GetComponent <ParentFollow>(); if (component3 != null) { component3.HitParent = GlobalVars.Instance.hitParent; component3.ParentSeq = GlobalVars.Instance.hitBirckman; } } } } }
public void createBullet(Vector3 pnt, Vector3 nml, int brickSeq, int bulletId, int hitState) { if (!(bulletObj == null)) { if (!isMuzzle) { if (dic.ContainsKey(bulletId)) { ProjectileWrap projectileWrap = dic[bulletId]; if (projectileWrap != null) { Object.DestroyImmediate(projectileWrap.projectile); dic.Remove(bulletId); } } if (!(bulletObj == null)) { GameObject gameObject = Object.Instantiate((Object)bulletObj) as GameObject; gameObject.transform.position = pnt; gameObject.transform.forward = nml; if (brickSeq >= 0 && hitState == 1) { CheckBrickDead component = gameObject.GetComponent <CheckBrickDead>(); component.brickID = brickSeq; } if (brickSeq >= 0 && hitState == 2) { CheckMonDead component2 = gameObject.GetComponent <CheckMonDead>(); component2.MonID = brickSeq; } if (hitState == 0 || hitState == 2) { ParentFollow component3 = gameObject.GetComponent <ParentFollow>(); if (component3 != null) { component3.HitParent = GlobalVars.Instance.hitParent; component3.ParentSeq = GlobalVars.Instance.hitBirckman; GlobalVars.Instance.hitParent = null; GlobalVars.Instance.hitBirckman = -1; } } } } else { GameObject gameObject2 = Object.Instantiate((Object)bulletObj) as GameObject; gameObject2.transform.position = pnt; gameObject2.transform.forward = nml; if (brickSeq >= 0 && hitState == 1) { CheckBrickDead component4 = gameObject2.GetComponent <CheckBrickDead>(); component4.brickID = brickSeq; } if (brickSeq >= 0 && hitState == 2) { CheckMonDead component5 = gameObject2.GetComponent <CheckMonDead>(); component5.MonID = brickSeq; } if (hitState == 0 || hitState == 2) { ParentFollow component6 = gameObject2.GetComponent <ParentFollow>(); if (component6 != null) { component6.HitParent = GlobalVars.Instance.hitParent; component6.ParentSeq = GlobalVars.Instance.hitBirckman; GlobalVars.Instance.hitParent = null; GlobalVars.Instance.hitBirckman = -1; } } } } }