コード例 #1
0
 void fireArrow(Entity mob, Stats stats, float rotate = 0)
 {
     //Instantiates the projectile with some speed
     GameObject basicArrow = MonoBehaviour.Instantiate (Resources.Load ("Skills/Arrow_Placeholder")) as GameObject;
     projectile = new ScatterShotProjectile (basicArrow, stats);
     basicArrow.GetComponent<basic_projectile> ().setProjectile (projectile);
     //Initiates the projectile's position and rotation
     basicArrow.transform.position = mob.headTransform.position;
     basicArrow.transform.rotation = mob.headTransform.rotation;
     basicArrow.transform.Translate (Vector3.up * 0.7f);
     basicArrow.transform.RotateAround (basicArrow.transform.position, Vector3.forward, rotate);
     projectile.projectileOnStart();
     projectile.chainTimes = properties["chainCount"];
 }
コード例 #2
0
 public override void skillLogic(Entity mob, Stats stats)
 {
     //Instantiates the projectile with some speed
     GameObject basicArrow = MonoBehaviour.Instantiate(Resources.Load("Skills/Arrow_Placeholder")) as GameObject;
     projectile = new StunArrowProjectile (basicArrow, stats);
     basicArrow.GetComponent<basic_projectile> ().setProjectile (projectile);
     //Initiates the projectile's position and rotation
     basicArrow.transform.position = mob.headTransform.position;
     basicArrow.transform.rotation = mob.headTransform.rotation;
     basicArrow.transform.localScale *= 4;
     basicArrow.transform.Translate(Vector3.up * 0.7f);
     projectile.projectileOnStart();
     AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Skills/pew"), mob.headTransform.position);
 }