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

Merge branch 'main' into 'main'

Placement_objects

See merge request !67
parents 32449af0 3453ce2f
1 merge request!67Placement_objects
This diff is collapsed.
...@@ -2,21 +2,21 @@ ...@@ -2,21 +2,21 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
using TMPro;
public class DragDrop : MonoBehaviour, IDragHandler public class DragDrop : MonoBehaviour, IDragHandler, IDropHandler
{ {
[SerializeField] private Canvas canvas; [SerializeField] private Canvas canvas;
private RectTransform rectransform; private RectTransform rectransform;
public TMP_Text textshowed;
private void Awake() private void Awake()
{ {
rectransform = GetComponent<RectTransform>(); rectransform = GetComponent<RectTransform>();
} }
...@@ -24,7 +24,23 @@ public class DragDrop : MonoBehaviour, IDragHandler ...@@ -24,7 +24,23 @@ public class DragDrop : MonoBehaviour, IDragHandler
{ {
rectransform.anchoredPosition += eventData.delta / canvas.scaleFactor; 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:
...@@ -6,13 +6,16 @@ using TMPro; ...@@ -6,13 +6,16 @@ using TMPro;
public class Ui : MonoBehaviour 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 motiv;
public static float difficulty; public static float difficulty;
public static int fame; public static int fame;
public static int nbObst; public static int nbObst = 5;
public static bool stop = false;
public static int rep;
public static bool start = false;
public GameObject prefab; public GameObject prefab;
public Canvas parent; public Canvas parent;
......
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using TMPro;
public class nbObstacle : MonoBehaviour public class nbObstacle : MonoBehaviour
{ {
public TMP_Text textshowed;
public static void decreaseObstacle() public static void decreaseObstacle()
{ {
Ui.nbObst = Ui.nbObst - 1; 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