Skip to content
Snippets Groups Projects
Commit cb3710a4 authored by GIRAULT COLIN's avatar GIRAULT COLIN
Browse files

UI_début

parent 5879c047
Branches
Tags
2 merge requests!25Ui,!24UI_début
Showing
with 3825 additions and 3 deletions
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ButtonHandler : MonoBehaviour
{
public Text Textfield;
public void SetText(string text)
{
Textfield.text = text;
}
}
fileFormatVersion: 2
guid: 7d16b747398caea419003cdc1c753b13
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2 fileFormatVersion: 2
guid: abd465ab42a6e294b8c593401167d51d guid: 17fb8e4df07a1f043bbb1a2d5336addc
folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:
......
This diff is collapsed.
fileFormatVersion: 2
guid: ddfc8898776cdfd4c9c465d2281ef4a3
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ExitScene : MonoBehaviour
{
// Start is called before the first frame update
public void Exit()
{
Application.Quit();
}
}
fileFormatVersion: 2
guid: a7edb75851d32e34d95d4cab1584002c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -14,18 +14,24 @@ public class GameManager : MonoBehaviour ...@@ -14,18 +14,24 @@ public class GameManager : MonoBehaviour
public TextMeshProUGUI textMeshID; public TextMeshProUGUI textMeshID;
public GameObject room; public GameObject room;
public static float motiv;
public static float difficulty;
public static int fame;
public static bool stop = false;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
_roomManager = this.room.GetComponent<RoomManager>(); _roomManager = this.room.GetComponent<RoomManager>();
updateID(_roomManager.actualRoom, _roomManager.actualRoomColor ); updateID(_roomManager.actualRoom, _roomManager.actualRoomColor );
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
} }
// Update textMeshID // Update textMeshID
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneChanger : MonoBehaviour
{
public void LoadScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
}
}
fileFormatVersion: 2
guid: d275982db560c1a49843462e3730a0e3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class changeminus : MonoBehaviour
{
public static float plus = GameManager.motiv;
public void changeMinus(string word)
{
plus = GameManager.difficulty;
plus--;
if (plus < 0)
{
plus = 0;
}
GameManager.difficulty = plus;
}
}
fileFormatVersion: 2
guid: 23ab3ae128f56e241b83e249e823556a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using UnityEngine.SceneManagement;
public class changeplus : MonoBehaviour
{
public static float moins;
public void changePlus(string word)
{
moins = GameManager.difficulty;
moins++;
if (moins > 10)
{
moins = 10;
}
GameManager.difficulty = moins;
}
}
fileFormatVersion: 2
guid: ef740db83eb559f43a863d061e079ade
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class diff_scale : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
GameManager.motiv = 5f;
}
// Update is called once per frame
void Update()
{
float ech = GameManager.difficulty/10;
transform.localScale = new Vector3 (ech,1,1);
if (GameManager.difficulty < 0)
{
GameManager.difficulty = 0;
}
}
}
fileFormatVersion: 2
guid: e5bb377307b2f3c4fa798dd192a7c84b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class motiv_scale : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (GameManager.stop)
{
}
else
{
float ech = GameManager.motiv / 10;
transform.localScale = new Vector3(ech, 1, 1);
if (GameManager.motiv < 0)
{
GameManager.motiv = 0;
}
if (GameManager.motiv > 10)
{
GameManager.motiv = 10;
}
if (GameManager.difficulty < 2)
{
GameManager.motiv = GameManager.motiv - 0.003f;
}
else if (GameManager.difficulty > 4)
{
GameManager.motiv = GameManager.motiv - 0.003f;
}
else
{
GameManager.motiv = GameManager.motiv + 0.003f;
}
}
}
}
fileFormatVersion: 2
guid: 27b137fe436c7a647887730170b07276
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class validate_game : MonoBehaviour
{
public TMP_Text textshowed;
int actual_fame;
void Start()
{
}
public void changeFame(string word)
{
actual_fame = GameManager.fame;
if (GameManager.motiv < 2.5)
{
actual_fame = actual_fame + 0;
}
else if (GameManager.motiv <= 5)
{
actual_fame = actual_fame +(10 + (int)GameManager.motiv);
}
else if (GameManager.motiv > 5)
{
actual_fame = actual_fame +(15 + (int)GameManager.motiv);
}
textshowed.text = "Réputation : " + actual_fame.ToString(); ;
GameManager.fame = actual_fame;
GameManager.stop = true;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment