Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Uncle Dave · Jul 10, 2012 at 04:33 AM · downloadpdf

How to download pdf in virtual art gallery

Hi,

I'm a teacher who is trying to learn a bit about Unity to create a 3D art gallery to showcase our students' artworks.

A mockup trial version is here: http://www.mylongrun.com/smartmaths/WebPlayer.html

As you can see, you can click on a canvas and it will open a pdf file which contains info about that artwork. Each student will submit their own jpg (to go on the canvas) and their own pdf (which will describe their artwork)

Problem: At the moment, the pdf loads in the same window as the unity game. Therefore, it's not very practical. You can read the pdf, but if you want to look at another, you've got to hit the back button, which then takes you to the start, and re-loads the project.

Question: Is it possible to alter the script below, so that the pdf opens in a new tab or new window in the user's browser?

Thanks very much for your time,

Dave

Script:

var url = "url"; var link = "link"; var range : float; var theplayer : GameObject; var loaded : boolean;

var loadingimage : Texture2D;

function Update () {

range=Vector3.Distance(theplayer.transform.position,transform.position); if (range<25 && loaded==false){ loaded=true; getimage(); } }

function getimage(){ renderer.material.mainTexture = loadingimage; // access url var www : WWW = new WWW (url);

// wait yield www;

// place image renderer.material.mainTexture = www.texture; }

function OnMouseDown () { Application.OpenURL (link); }

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MileSplit · May 08, 2013 at 08:53 PM 0
Share

Hello Dave! For the future please format your code, it makes it so much easier to read. :) To do this, when composing your question, select your code and press the Code Sample button. (the one with the 101010). Have a great day!

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by captain00000000 · Oct 06, 2012 at 02:02 PM

I also trying to similar project. Work with Numbers naming names (such as "001" "002" "003"). The data (such as 001.JPG 001.PNG 001.ogg 001.TXT ) upload to server. Creat a father objects, all works are child objects, and Get name of child objects. From the server batch download all the data. Through the father add data to child , and the name of data is childName +".jpg" or childName +".txt" ... This is my test : http://www.redsky.org.cn/00test/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Aron-Versteeg · May 08, 2013 at 08:40 PM

hi Dave,

I'm having the same problem trying to open a PDF in a new web tab from Unity. I came across your post when looking for a solution. When checking your mockup trial version it seems that it DOES open PDF's in a new window. Did you find a solution and changed the script?

if so, would you be willing to share it? Thanks in advance, Aron

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Graham-Dunnett · May 08, 2013 at 08:44 PM

See:

http://docs.unity3d.com/Documentation/Manual/UnityWebPlayerandbrowsercommunication.html

This page explains how your Unity code can call Javascript code running in the browser. Since Unity cannot open a new browser window directly, you need to tell the hosting page to open a new browser window.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Aron-Versteeg · May 08, 2013 at 09:35 PM 0
Share

thx for your link. I solved the issue using this comment http://forum.unity3d.com/threads/154226-Proper-way-to-open-URL-in-flash

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Download Links from GUI 2 Answers

how to download pdf/image file in unity web player? 1 Answer

Printable a Certificate for completing a task 1 Answer

Downloadable manual 2 Answers

Downloading unity 3 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges