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 Looped Gaming · Jul 26, 2014 at 02:30 AM · login

Login Scrips

i am making a app for me and my group where we share our files and we need some help with our login scrip there is one MAIN account and it disappears when you put it in the right code but if someone could help me and sort of edit the script so it could have multiple accounts without a server and so it would load a different lvl Thx!

-Looped Gaming Team

C# scrip

var btnColorOn : Color = Color(1.0f, 1.0f, 1.0f, 1.0f); var btnColorOff : Color = Color(0.4f, 0.4f, 0.4f, 1.0f);

 private var btnColor = btnColorOff;
 private var username : String = String.Empty;
 private var password : String = String.Empty;
 private var correctLogin : boolean;
  
 function Update()
 {
     correctLogin = (username == "LG" && password == "1234");
    
      var speed = Time.deltaTime * 4;
     var targetColor = correctLogin ? btnColorOn : btnColorOff;
  
     btnColor.r = Mathf.MoveTowards(btnColor.r, targetColor.r, speed); 
     btnColor.g = Mathf.MoveTowards(btnColor.g, targetColor.g, speed); 
     btnColor.b = Mathf.MoveTowards(btnColor.b, targetColor.b, speed); 
     btnColor.a = Mathf.MoveTowards(btnColor.a, targetColor.a, speed); 
 }
  
 function OnGUI()
 {
     var windowRect : Rect;
     windowRect.x = Screen.width / 2 - 100;
     windowRect.y = Screen.height / 2 - 50;
     windowRect.width = 200;
     windowRect.height = 100;
  
     GUI.Window(0, windowRect, OnWindowGUI, "Authentication");
 }
  
 function OnWindowGUI()
 {
     username = GUILayout.TextField(username);
     password = GUILayout.PasswordField(password, '*'[0]);
     GUI.color = btnColor;
     if (GUILayout.Button("Login") && correctLogin)
     {
         // Add your login code here...
         enabled = false;
     }
     GUI.color = Color.white;
     }
Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by DontShooot · Jul 26, 2014 at 03:43 AM

I don't think there some way to make secured authentication without server. The simple way can be use a xml with logins and password's hashes.

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 thelime · Jul 26, 2014 at 09:49 PM

Hi maybe this can work?

 correctLogin = ((username == "LG" && password == "1234") || (username == "LG2" && password == "456"))
  
 ;
  
 
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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Player creates personal profile 0 Answers

PHP Login not returning anything 1 Answer

Necessary Data Rewind Wasn't Possible WWWForm Error 0 Answers

Detect Game Center login prompt? 1 Answer

How can i create a network mutliplayer login? 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