Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by jeyjeremy123 · Jun 24, 2020 at 08:51 AM · databasedatawebrequestlinkreal-time

Link real-time data to unity

How can I link or connect or read real time data from a website or database? Basically I have this model where I show it using the unity app, but at the same time, that model have some kind of reading, like the reading of water level and so on, so I'm trying to link those reading(real time data) into the unity app, so even when the reading is changed, the data in the unity app will also change according to the reading.

Comment
Add comment · Show 2
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 Bunny83 · Jun 24, 2020 at 10:30 AM 0
Share

Sorry, but... what?


What does "real" mean in this context and what's the opposite of it? What API?!?

This question is about to get closed due to insufficient information. Please edit your question ASAP since it's "urgent".

avatar image jeyjeremy123 Bunny83 · Jun 25, 2020 at 01:25 AM 0
Share

Alright i will edit

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by NaahL · Jun 25, 2020 at 02:25 AM

Are you talking about showing the time on some text?

 using UnityEngine;
 using System;
 using UnityEngine.UI;
 
 public class timer : MonoBehaviour
 {
     public Text clockText;
     
     void Update()
     {
         string hour = DateTime.Now.Hour.ToString();
         string minute = DateTime.Now.Minute.ToString();
         string second = DateTime.Now.Second.ToString();
     
         clockText.text = hour + ":" + minute + ":" + second;
     }
 }
Comment
Add comment · Show 4 · 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 NaahL · Jun 25, 2020 at 02:27 AM 0
Share

I hope this helped

avatar image jeyjeremy123 NaahL · Jun 25, 2020 at 02:37 AM 0
Share

Sorry to disappoint you, but this is not the "time" i meant, what I meant is like, for example, bitcoin graph, their data is always changing according to the time, and I want to show that data on unity, and follow its data, so whenever the data change on bitcoin, it changes in unity too. But thank you for ur reply :) Idk whether i gave the correct example, but i hope you get what Im saying

avatar image NaahL jeyjeremy123 · Jun 25, 2020 at 02:45 AM 0
Share

Oh ok sorry

Show more comments
avatar image
0

Answer by tuinal · Jun 25, 2020 at 03:48 AM

It's no different to doing it in any C# application using System.Net. Below is a generic example ripped off stackoverflow.

How you parse & use the returned data string is up to you, and is usually the time consuming part.

 string urlAddress = "http://google.com";
 
 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlAddress);
 HttpWebResponse response = (HttpWebResponse)request.GetResponse();
 
 if (response.StatusCode == HttpStatusCode.OK)
 {
   Stream receiveStream = response.GetResponseStream();
   StreamReader readStream = null;
 
   if (String.IsNullOrWhiteSpace(response.CharacterSet))
      readStream = new StreamReader(receiveStream);
   else
      readStream = new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));
 
   string data = readStream.ReadToEnd();
 
   response.Close();
   readStream.Close();
 }

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 jeyjeremy123 · Jun 25, 2020 at 06:28 AM 0
Share

Alright, i'll try my best, thank you

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

138 People are following this question.

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

Related Questions

Calling Json script and displaying the Images within the script 0 Answers

Alternative to storing data in DB's 2 Answers

Storing Constant data in a mobile game 0 Answers

Unity Web Player Failed To Download Data File 1 Answer

Do you need a realtime data monitor for Unity in your Oculus VR heaset? 0 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