Rearraged layout, navigates more like the prototype. Cleaned up visuals.
This commit is contained in:
parent
cde6bed6eb
commit
94bf0ca36d
12 changed files with 204 additions and 7 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -6,24 +6,49 @@ public class GetData : MonoBehaviour
|
|||
{
|
||||
public Button thisbutton;
|
||||
public Text objectText;
|
||||
public Text username;
|
||||
public Text score;
|
||||
|
||||
public string request = "http://corder.tech/mocha/users/*";
|
||||
public bool displayseparated = true;
|
||||
|
||||
public string request = "http://corder.tech/mocha/users/5";
|
||||
|
||||
void Start()
|
||||
{
|
||||
thisbutton = GetComponent<Button> ();
|
||||
|
||||
if (displayseparated)
|
||||
{
|
||||
username = GetComponent<Text> ();
|
||||
score = GetComponent<Text> ();
|
||||
|
||||
CallGetDataSeparated ();
|
||||
}
|
||||
else
|
||||
{
|
||||
objectText = GetComponent<Text> ();
|
||||
|
||||
thisbutton.onClick.AddListener (CallGetData);
|
||||
CallGetData ();
|
||||
}
|
||||
}
|
||||
|
||||
public void CallGetData()
|
||||
{
|
||||
DisplayAll(request, objectText);
|
||||
}
|
||||
|
||||
public void DisplayAll(string request, Text objectText)
|
||||
{
|
||||
MochaParser parser = new MochaParser();
|
||||
StartCoroutine (parser.DisplayOutput(request, objectText));
|
||||
}
|
||||
|
||||
public void CallGetDataSeparated()
|
||||
{
|
||||
DisplayAllSeparated(request, username, score);
|
||||
}
|
||||
|
||||
public void DisplayAllSeparated(string request, Text u, Text s)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
49
MoCha/Assets/Scripts/GetDataManager.cs
Normal file
49
MoCha/Assets/Scripts/GetDataManager.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class GetDataManager : MonoBehaviour
|
||||
{
|
||||
public Text objectText;
|
||||
public Text username;
|
||||
public Text score;
|
||||
|
||||
public bool displayseparated = true;
|
||||
|
||||
public string request = "http://corder.tech/mocha/users/5";
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (displayseparated)
|
||||
{
|
||||
CallGetDataSeparated ();
|
||||
}
|
||||
else
|
||||
{
|
||||
CallGetData ();
|
||||
}
|
||||
}
|
||||
|
||||
public void CallGetData()
|
||||
{
|
||||
DisplayAll(request, objectText);
|
||||
}
|
||||
|
||||
public void DisplayAll(string request, Text objectText)
|
||||
{
|
||||
MochaParser parser = new MochaParser();
|
||||
StartCoroutine (parser.DisplayOutput(request, objectText));
|
||||
}
|
||||
|
||||
public void CallGetDataSeparated()
|
||||
{
|
||||
DisplayAllSeparated(request, username, score);
|
||||
}
|
||||
|
||||
public void DisplayAllSeparated(string request, Text u, Text s)
|
||||
{
|
||||
MochaParser parser = new MochaParser();
|
||||
StartCoroutine (parser.DisplayOutputSeparated(false, request, u, s));
|
||||
}
|
||||
}
|
13
MoCha/Assets/Scripts/GetDataManager.cs.meta
Normal file
13
MoCha/Assets/Scripts/GetDataManager.cs.meta
Normal file
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 585c046d34bb8d84b8538fbc27019dcd
|
||||
timeCreated: 1524512941
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -124,7 +124,8 @@ public class MochaParser
|
|||
|
||||
public string OutputIds()
|
||||
{
|
||||
string output = "Player ID\n";
|
||||
//string output = "Player ID\n";
|
||||
string output = "";
|
||||
|
||||
foreach (PlayerInfo pi in players)
|
||||
{
|
||||
|
@ -137,7 +138,8 @@ public class MochaParser
|
|||
|
||||
public string OutputUsernames()
|
||||
{
|
||||
string output = "Username\n";
|
||||
//string output = "Username\n";
|
||||
string output = "";
|
||||
|
||||
foreach (PlayerInfo pi in players)
|
||||
{
|
||||
|
@ -150,7 +152,8 @@ public class MochaParser
|
|||
|
||||
public string OutputScores()
|
||||
{
|
||||
string output = "Score\n";
|
||||
//string output = "Score\n";
|
||||
string output = "";
|
||||
|
||||
foreach (PlayerInfo pi in players)
|
||||
{
|
||||
|
@ -172,7 +175,7 @@ public class MochaParser
|
|||
t.text = OutputInfo ();
|
||||
}
|
||||
|
||||
public IEnumerator DisplayOutputSeparated(string request, Text usernames, Text scores)
|
||||
public IEnumerator DisplayOutputSeparated(bool titles, string request, Text usernames, Text scores)
|
||||
{
|
||||
yield return MakeRequest (request);
|
||||
|
||||
|
|
BIN
MoCha/Assets/Sprites/reload.png
Normal file
BIN
MoCha/Assets/Sprites/reload.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
107
MoCha/Assets/Sprites/reload.png.meta
Normal file
107
MoCha/Assets/Sprites/reload.png.meta
Normal file
|
@ -0,0 +1,107 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 15008b49b60a4b2459234898f69a0222
|
||||
timeCreated: 1524512444
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Reference in a new issue