Example #1
0
    public static PhysicsUFOFlyAction GetSSAction(Vector3 direction, float angle, float power)
    {
        PhysicsUFOFlyAction action = CreateInstance <PhysicsUFOFlyAction>();

        if (direction.x == -1)
        {
            action.start_vector = Quaternion.Euler(new Vector3(0, 0, -angle)) * Vector3.left * power;
        }
        else
        {
            action.start_vector = Quaternion.Euler(new Vector3(0, 0, angle)) * Vector3.right * power;
        }
        action.power = power;
        return(action);
    }
Example #2
0
 public void UFOfly(GameObject disk, float angle, float power)
 {
     fly = PhysicsUFOFlyAction.GetSSAction(disk.GetComponent <DiskData>().direction, angle, power);
     this.RunAction(disk, fly, this);
 }