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

Merge branch 'main' into 'main'

Suite Placement Obstacles

See merge request !78
parents d824d203 44ba4cff
Branches
1 merge request!78Suite Placement Obstacles
Showing
with 277 additions and 730 deletions
This diff is collapsed.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class ChangeMin : MonoBehaviour
{
public static float plus = Ui.motiv;
public void changeMinus(string word)
{
plus = Ui.difficulty;
plus--;
if (plus < 0)
{
plus = 0;
}
Ui.difficulty = plus;
}
}
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 = Ui.difficulty;
moins++;
if (moins > 10)
{
moins = 10;
}
Ui.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;
using UnityEngine.EventSystems;
using TMPro;
public class DragDropM : MonoBehaviour, IDragHandler, IDropHandler
{
[SerializeField] private Canvas canvas;
private RectTransform rectransform;
public TMP_Text textshowed;
bool block = true;
private void Awake()
{
rectransform = GetComponent<RectTransform>();
}
public void OnDrag(PointerEventData eventData)
{
rectransform.anchoredPosition += eventData.delta / canvas.scaleFactor;
}
public void OnDrop(PointerEventData eventData)
{
while (block == true)
{
Ui.nbObst = Ui.nbObst - 1;
Ui.difficulty = Ui.difficulty + 2;
block = false;
}
}
}
fileFormatVersion: 2
guid: 02e48c10dc39a4c498c2eccc20883084
guid: 380d8a9115a818141b41c663eb957408
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using TMPro;
public class DragDropS : MonoBehaviour, IDragHandler, IDropHandler
{
[SerializeField] private Canvas canvas;
private RectTransform rectransform;
public TMP_Text textshowed;
bool block = true;
private void Awake()
{
rectransform = GetComponent<RectTransform>();
}
public void OnDrag(PointerEventData eventData)
{
rectransform.anchoredPosition += eventData.delta / canvas.scaleFactor;
}
public void OnDrop(PointerEventData eventData)
{
while (block == true)
{
Ui.nbObst = Ui.nbObst - 1;
Ui.difficulty = Ui.difficulty + 3;
block = false;
}
}
}
fileFormatVersion: 2
guid: 23ab3ae128f56e241b83e249e823556a
guid: 6eb5a4ed1248c2d4eb03f052c9db5eb4
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
......@@ -4,13 +4,14 @@ using UnityEngine;
using UnityEngine.EventSystems;
using TMPro;
public class DragDrop : MonoBehaviour, IDragHandler, IDropHandler
public class DragDropW : MonoBehaviour, IDragHandler, IDropHandler
{
[SerializeField] private Canvas canvas;
private RectTransform rectransform;
public TMP_Text textshowed;
bool block = true;
private void Awake()
......@@ -29,18 +30,19 @@ public class DragDrop : MonoBehaviour, IDragHandler, IDropHandler
public void OnDrop(PointerEventData eventData)
{
if (Ui.protec == false)
{
textshowed = GameObject.Find("nbobstacle").GetComponent<TMP_Text>();
textshowed.GetComponent<TMP_Text>().text = "dffd";
}
else
while(block == true)
{
textshowed = GameObject.Find("nbobstacle").GetComponent<TMP_Text>();
textshowed.GetComponent<TMP_Text>().text = "aaaaa";
Ui.nbObst = Ui.nbObst - 1;
Ui.difficulty = Ui.difficulty + 1;
block = false;
}
}
}
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;
}
}
......@@ -6,12 +6,12 @@ using UnityEngine.EventSystems;
public class midObj : MonoBehaviour, IDropHandler
{
private GameObject go;
public void OnDrop(PointerEventData eventData)
{
float Uix = GameObject.Find("Image").transform.position.x;
float Uiy = GameObject.Find("Image").transform.position.y;
Ui.nameObj = GameObject.FindWithTag("moyen").tag;
float objx = GameObject.Find("bin").transform.position.x;
float objy = GameObject.Find("bin").transform.position.y;
......@@ -20,17 +20,11 @@ public class midObj : MonoBehaviour, IDropHandler
{
go = GameObject.FindWithTag("moyen");
Destroy(go);
Ui.difficulty = Ui.difficulty - 2;
Ui.nbObst = Ui.nbObst + 1;
}
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;
}
}
}
......@@ -9,6 +9,8 @@ public class strongObj : MonoBehaviour, IDropHandler
public void OnDrop(PointerEventData eventData)
{
Ui.nameObj = GameObject.FindWithTag("fort").tag;
float objx = GameObject.Find("bin").transform.position.x;
float objy = GameObject.Find("bin").transform.position.y;
......@@ -17,7 +19,8 @@ public class strongObj : MonoBehaviour, IDropHandler
{
go = GameObject.FindWithTag("fort");
Destroy(go);
Ui.difficulty = Ui.difficulty - 3;
Ui.nbObst = Ui.nbObst + 1;
}
}
......
......@@ -9,15 +9,20 @@ public class weakObj : MonoBehaviour, IDropHandler
public void OnDrop(PointerEventData eventData)
{
Ui.nameObj = GameObject.FindWithTag("faible").tag;
float objx = GameObject.Find("bin").transform.position.x;
float objy = GameObject.Find("bin").transform.position.y;
if (objx + 90 > Input.mousePosition.x && objx - 90 < Input.mousePosition.x && objy + 90 > Input.mousePosition.y && objy - 90 < Input.mousePosition.y)
{
go = GameObject.FindWithTag("faible");
Destroy(go);
{
go = GameObject.FindWithTag("faible");
Destroy(go);
Ui.difficulty = Ui.difficulty - 1;
Ui.nbObst = Ui.nbObst + 1;
}
}
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using TMPro;
public class DiffScale : MonoBehaviour
{
public TMP_Text textshowed;
// Start is called before the first frame update
void Start()
{
......@@ -24,7 +25,8 @@ public class DiffScale : MonoBehaviour
Ui.difficulty = 0;
}
textshowed = GameObject.Find("nbobstacle").GetComponent<TMP_Text>();
textshowed.GetComponent<TMP_Text>().text = "Obstacles restants : " + Ui.nbObst.ToString();
}
}
......@@ -8,13 +8,15 @@ 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 int nbObst = 5;
public static string nameObj;
public GameObject prefab;
public Canvas parent;
}
......@@ -8,9 +8,9 @@ public class nbObstacle : MonoBehaviour
public TMP_Text textshowed;
public static void decreaseObstacle()
private void Start()
{
Ui.nbObst = Ui.nbObst - 1;
textshowed.GetComponent<TMP_Text>().text = "Obstacles restants : " + Ui.nbObst.ToString();
}
}
T3-Unity/Assets/TextMesh Pro/Sprites/CoolClips_arch0117.png

54.1 KiB

fileFormatVersion: 2
guid: 6a60629f4bb329744888c825d873f9cb
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
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
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
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}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: d74f620a081855f498b9967ea84322be
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
T3-Unity/Assets/TextMesh Pro/Sprites/bouncers-250x250.png

38.5 KiB

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