GUI de gameplay

This commit is contained in:
antoine.mcnabb 2016-01-31 10:26:14 -05:00
parent 01361d8ae8
commit 7664e645d1
4 changed files with 142 additions and 0 deletions

View File

@ -0,0 +1,52 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &155010
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 401702}
- 114: {fileID: 11451600}
m_Layer: 0
m_Name: GUIManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &401702
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 155010}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 227.282471, y: 81.0362015, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!114 &11451600
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 155010}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f64ee281a9baddc40a746420c5bb884f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 155010}
m_IsPrefabParent: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 10be2fb46e4285942b2957ae293fd714
timeCreated: 1454247986
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,70 @@
using UnityEngine;
using System.Collections;
public class GUIGameplay : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI()
{
// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
for(int i = 0; i<GameState.Instance.players.Length;++i)
{
Color temp = GUI.color;
string playerName = "";
switch (i)
{
case 0:
GUI.color = new Color(1, 1, 0, 0.5f);
playerName = "Yellow beard";
break;
case 1:
GUI.color = new Color(1,0 , 0, 0.5f);
playerName = "Red beard";
break;
case 2:
GUI.color = new Color(0, 0, 1, 0.5f);
playerName = "Black beard";
break;
default:
break;
}
GUI.Box(new Rect(10+ Screen.width /3 * i , 10, 200, 90), playerName);
GUI.color = temp;
Player p = GameState.Instance.players[i];
for (int j = 0;j< p.letters.Length;++j)
{
char character = (char) p.letters[j];
//Debug.Log(character);
Texture2D rune = Resources.Load<Texture2D>("runic_" + (char)('a' + character));
// Debug.Log(p.score);
if (j+1 > p.index)
{
temp = GUI.color ;
GUI.color = new Color(1f, 1f, 1f, 0.50f);
GUI.DrawTexture(new Rect(20 + Screen.width / 3 * i + j * 30 + 20, 40, 30, 30), rune);
GUI.color = temp;
}
else
{
GUI.DrawTexture(new Rect(20 + Screen.width / 3 * i + j * 30 + 20, 40, 30, 30), rune);
}
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f64ee281a9baddc40a746420c5bb884f
timeCreated: 1454244894
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: