Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 ccretrberk · May 18, 2018 at 03:07 PM · scripting problemcontroller

UI Button Change Scene with Game Controller from a Mobile Device

Hello everyone,

I am trying to do user interface... i want to control my Pc Application which is made by unity with my phone application which is made by unity again... when i press the ui button i want to change the scene on pc application.

but there are several problems. i managed to connect server with my phone, but UI buttons not works.

i know there should be Networkserver and networkclient scripts..

here is NetworkServer code

 using System;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine.Networking;
 using UnityEngine.Networking.NetworkSystem;
 using UnityStandardAssets.CrossPlatformInput;
 using UnityEngine;
 
 
 public class NetworkServerUI : MonoBehaviour {
 
     private void OnGUI()
     {
         string ipaddress = Network.player.ipAddress;
         GUI.Box(new Rect(10, Screen.height - 50, 100,50), ipaddress);
         GUI.Label(new Rect(20, Screen.height - 35, 100, 20), "Status:" + NetworkServer.active);
         GUI.Label(new Rect(20, Screen.height - 20, 100, 20), "Connected:" + NetworkServer.connections.Count);
     }
     // Use this for initialization
     void Start () {
         NetworkServer.Listen(25000);
 
     }
     
     // Update is called once per frame
     void Update () {
         
     }
 }


Here is client code;

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine.Networking;
 using UnityEngine.Networking.NetworkSystem;
 using UnityEngine;
 
 public class NetworkClientUI : MonoBehaviour {
 
     NetworkClient client;
     void OnGUI()
     {
         string ipaddress = Network.player.ipAddress;
         GUI.Box(new Rect(10, Screen.height - 50, 100, 50), ipaddress);
         GUI.Label(new Rect(20, Screen.height - 30, 100, 20), "Status:" + client.isConnected);
 
         if(!client.isConnected)
         {
             if(GUI.Button(new Rect(10,10,60,50),"Connect"))
             {
                 Connect();
             }
         }
     }
     // Use this for initialization
     void Start () {
         client = new NetworkClient();
     }
     void Connect()
     {
         client.Connect("192.168.1.7", 25000);
     }
     // Update is called once per frame
     void Update () {
         
     }
 }

here is change scene code;

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class ChangeScene : MonoBehaviour {
 
 
     public void ChangeToScene (string sceneName)
     {
         Application.LoadLevel(sceneName);
     }
 }


Please help me...

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 ccretrberk · May 21, 2018 at 08:10 PM 0
Share

??????????

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ccretrberk · May 19, 2018 at 08:09 AM

Can someone try to wake my mind up?

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

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

149 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

"Mouse Scrollwheel" on xbox 360controller 2 Answers

Limit number of face buttons being simultaneously held. 1 Answer

Question about moving an object technique 3 Answers

MMD How to export model and animations to Unity as 3rd person controller? 2 Answers

How to change the walk speed of the FPSController from another script? 2 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