|
|
@@ -65,11 +65,18 @@ namespace Subworlds.Scripts
|
|
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
{
|
|
|
+ this.dir = this.target.transform.position - this.t.position;
|
|
|
+ this.dir.Normalize();
|
|
|
+ var newRotation = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
|
|
|
+ z = (int) newRotation;
|
|
|
+ z = (z + 360) % 360;
|
|
|
+ gameObject.transform.GetChild(0).GetChild(0).GetChild(0).localEulerAngles = new Vector3(0, ((z + 360 - 90) % 360) > 180 ? 0 : 180, ((z + 360 - 90) % 360) > 180 ? z : 180 - z);
|
|
|
var pos = this.target.transform.position;
|
|
|
- yield return new WaitForSeconds(0.125f);
|
|
|
- var p = (GameObject)Network.Instantiate(Resources.Load("proj/pirateproj"), this.t.position, Quaternion.identity, 0);
|
|
|
+ var dist = 2.1f;
|
|
|
+ var endPosition = new Vector3(this.t.position.x + Mathf.Cos((Mathf.PI / 180) * z) * dist, this.t.position.y + Mathf.Sin((Mathf.PI / 180) * z) * dist, this.t.position.z);
|
|
|
+ var p = (GameObject)Network.Instantiate(Resources.Load("proj/pirateproj"), endPosition, Quaternion.identity, 0);
|
|
|
p.SendMessage("EnemySet", pos, SendMessageOptions.DontRequireReceiver);
|
|
|
- yield return new WaitForSeconds(0.125f);
|
|
|
+ yield return new WaitForSeconds(0.625f);
|
|
|
yield return Seach(10);
|
|
|
}
|
|
|
|