Esempio n. 1
0
    public static PFlyAction GetSSAction(GameObject disk)
    {
        Vector3    direction = disk.GetComponent <DiskData>().direction;
        float      speed     = disk.GetComponent <DiskData>().speed;
        float      angle1    = 20f;//Random.Range(15f, 30f);
        PFlyAction action    = CreateInstance <PFlyAction>();

        if (direction.x == -1)
        {
            Debug.Log(speed + " " + angle1);
            action.hirv = Quaternion.Euler(new Vector3(0, 0, -angle1)) * Vector3.left * speed;
        }
        else
        {
            action.hirv = Quaternion.Euler(new Vector3(0, 0, angle1)) * Vector3.right * speed;
        }
        return(action);
    }
Esempio n. 2
0
 public void fly(GameObject disk)
 {
     action = PFlyAction.GetSSAction(disk);
     this.RunAction(disk, action, this);
 }