コード例 #1
0
    public RuneTeleportState(Wizard w, teleport_rune r) : base(w)
    {
        allowsmovement = false;

        allowsabilities = false;

        starttime = Time.time;

        rune = r;
    }
コード例 #2
0
 public override void magic()
 {
     if (!(created))
     {
         Vector2 rot = new Vector2(1 - Random.value * 2, 1 - Random.value * 2);
         rot.Normalize();
         float      rotat = Mathf.Atan2(rot.x, rot.y) * Mathf.Rad2Deg;
         GameObject f     = GameObject.Instantiate(rune, wiz.transform.position + new Vector3(0f, -0.4f, 0f), Quaternion.Euler(0f, 0f, -rotat));
         current = f.GetComponent <teleport_rune> ();
         created = true;
     }
     else
     {
         wiz.state = new CastIntoState(wiz, this, new RuneTeleportState(wiz, current));
         current.activate();
         created = false;
     }
 }