Skip to content
Snippets Groups Projects
Commit 62a06d70 authored by MrWarzo's avatar MrWarzo :speech_balloon:
Browse files

Merge branch 'main' of git.unistra.fr:thepaindemii/TheLegendOfSimon_LAS21_T3_D

parents 67dabd21 3523d43a
Branches
1 merge request!77Main
Showing
with 613 additions and 479 deletions
This diff is collapsed.
namespace Scripts.IA
namespace Scripts.IA
{
using UnityEngine;
using Scripts.Waypoints;
......
namespace Scripts.IA
namespace Scripts.IA
{
using UnityEngine;
using Scripts.Waypoints;
......
......@@ -2,21 +2,21 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using TMPro;
public class DragDrop : MonoBehaviour, IDragHandler
public class DragDrop : MonoBehaviour, IDragHandler, IDropHandler
{
[SerializeField] private Canvas canvas;
private RectTransform rectransform;
public TMP_Text textshowed;
private void Awake()
{
rectransform = GetComponent<RectTransform>();
}
......@@ -24,7 +24,23 @@ public class DragDrop : MonoBehaviour, IDragHandler
{
rectransform.anchoredPosition += eventData.delta / canvas.scaleFactor;
}
public void OnDrop(PointerEventData eventData)
{
if (Ui.protec == false)
{
textshowed = GameObject.Find("nbobstacle").GetComponent<TMP_Text>();
textshowed.GetComponent<TMP_Text>().text = "dffd";
}
else
{
textshowed = GameObject.Find("nbobstacle").GetComponent<TMP_Text>();
textshowed.GetComponent<TMP_Text>().text = "aaaaa";
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class UiProtec : MonoBehaviour
{
public void protectedUi()
{
Ui.protec = true;
}
public void unProtectedUi()
{
Ui.protec = false;
}
}
fileFormatVersion: 2
guid: 02e48c10dc39a4c498c2eccc20883084
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -10,6 +10,9 @@ public class midObj : MonoBehaviour, IDropHandler
public void OnDrop(PointerEventData eventData)
{
float Uix = GameObject.Find("Image").transform.position.x;
float Uiy = GameObject.Find("Image").transform.position.y;
float objx = GameObject.Find("bin").transform.position.x;
float objy = GameObject.Find("bin").transform.position.y;
......@@ -20,5 +23,14 @@ public class midObj : MonoBehaviour, IDropHandler
}
if (Uix + 888.2423/2 > Input.mousePosition.x && Uix - 888.2423/2 < Input.mousePosition.x && objy + 66.11261/2 > Input.mousePosition.y && Uiy - 66.11261/2 < Input.mousePosition.y)
{
Ui.protec = false;
}
else
{
Ui.protec = true;
}
}
}
using Scripts.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SaveVariable : MonoBehaviour
{
public static int fame;
public static int nbParty = 0;
public static void Save()
{
fame = Ui.fame;
nbParty += 1;
Reload();
}
static void Reload()
{
SceneManager.LoadScene("Map_Tests1");
}
}
fileFormatVersion: 2
guid: 4f4e96cc9c027c4429bbd4a9e753ee10
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -20,7 +20,6 @@ public class MotivScale : MonoBehaviour
}
else
{
float ech = Ui.motiv / 100f;
transform.localScale = new Vector3(ech, 1, 1);
......
......@@ -6,16 +6,15 @@ using TMPro;
public class Ui : MonoBehaviour
{
public static bool stop = false;
public static bool start = false;
public static bool protec = false;
public static float motiv;
public static float difficulty;
public static int fame;
public static int nbObst;
public static bool stop = false;
public static int rep;
public static bool start = false;
public GameObject prefab;
public Canvas parent;
}
......@@ -11,34 +11,46 @@
public TMP_Text textshowed;
int actual_fame;
private static ValidateGame instance;
public void changeFame(string word)
private void Start()
{
instance = this;
Ui.fame = SaveVariable.fame;
actual_fame = Ui.fame;
textshowed.text = "Réputation : " + actual_fame.ToString();
}
public static ValidateGame getInstance()
{
return instance;
}
public void changeFame()
{
actual_fame = Ui.fame;
if (Ui.motiv < 2.5)
if (Ui.motiv < 25)
{
actual_fame = actual_fame + 0;
}
else if (Ui.motiv <= 5)
else if (Ui.motiv >= 25 && Ui.motiv <= 50)
{
actual_fame = actual_fame + (10 + (int)Ui.motiv / 2);
actual_fame = actual_fame + (10 + (int)Ui.motiv / 20);
}
else if (Ui.motiv > 5)
else if (Ui.motiv > 50)
{
actual_fame = actual_fame + (15 + (int)Ui.motiv / 2);
actual_fame = actual_fame + (15 + (int)Ui.motiv / 20);
}
textshowed.text = "Réputation : " + actual_fame.ToString(); ;
textshowed.text = "Réputation : " + actual_fame.ToString();
Ui.fame = actual_fame;
Ui.stop = true;
Ui.start = false;
SaveVariable.Save();
}
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class nbObstacle : MonoBehaviour
{
public TMP_Text textshowed;
public static void decreaseObstacle()
{
Ui.nbObst = Ui.nbObst - 1;
}
public void changeObs(string word)
{
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class scip : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
fileFormatVersion: 2
guid: de6aaac61bc640941b6724081c5d0eb9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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