This commit is contained in:
esteb
2023-01-25 09:47:28 +01:00
parent 6163642700
commit 4c4ad432df
6 changed files with 814 additions and 32 deletions

View File

@@ -9,6 +9,12 @@ public class SwipeManagementScript : MonoBehaviour
{
public TMP_Text header;
public TMP_Text textSteps;
public TMP_Text textNumber;
public TMP_Text header2;
public TMP_Text textSteps2;
public TMP_Text textNumber2;
public List<Text> lengths;
public int numberImage;
public int lengthTexts;
@@ -22,14 +28,10 @@ public class SwipeManagementScript : MonoBehaviour
public GameObject arrowHB;
public GameObject arrowPause;
public GameObject circleXY;
public GameObject circleHB;
public GameObject warning;
public Animator m_Animator;
public TMP_Text textNumber;
public List<int> images;
@@ -37,15 +39,17 @@ public class SwipeManagementScript : MonoBehaviour
private Vector2 endTouchPosition;
private GameObject image;
private Image imageUI;
// Start is called before the first frame update
void Start()
{
header.text = "Allumer la Speedy 100";
header2.text = "Allumer la Speedy 100";
textSteps.text = lengths[0].text;
textSteps2.text = lengths[0].text;
textNumber.text = "Step 1/" + (lengthTexts+1);
textNumber2.text = "Step 1/" + (lengthTexts+1);
arrowLeft.gameObject.SetActive(false);
}
@@ -62,63 +66,73 @@ public class SwipeManagementScript : MonoBehaviour
}else{
PreviousText();
}
if(endTouchPosition.y + 100 < startTouchPosition.y){
if(endTouchPosition.y + 80 < startTouchPosition.y){
SwipeDown();
}
if(endTouchPosition.y - 100 > startTouchPosition.y){
if(endTouchPosition.y - 80 > startTouchPosition.y){
SwipeUp();
}
}
if(numberImage == 1){
header.text = "Pour rappel : ";
header2.text = "Pour rappel : ";
arrow.SetActive(true);
warning.SetActive(false);
}
if(numberImage == 2)
{
header.text = "Initialisation : Sécurité";
header2.text = "Initialisation : Sécurité";
arrow.SetActive(false);
warning.SetActive(true);
}
if(numberImage == 3)
{
header.text = "Initialisation : Positionnement automatique";
header2.text = "Initialisation : Positionnement automatique";
warning.SetActive(false);
}
if(numberImage == 4)
{
header.text = "Placer la pièce à graver";
header2.text = "Placer la pièce à graver";
arrowGravure.SetActive(true);
arrowXY.SetActive(false);
}
if(numberImage == 5)
{
header.text = "Mise au point : Tête de traitement";
header2.text = "Mise au point : Tête de traitement";
arrowGravure.SetActive(false);
arrowXY.SetActive(true);
}
if(numberImage == 7)
{
header.text = "Mise au point : Outil focal";
header2.text = "Mise au point : Outil focal";
arrowXY.SetActive(false);
arrowHB.SetActive(false);
}
if(numberImage == 8){
header.text = "Mise au point : Table de gravure";
header2.text = "Mise au point : Table de gravure";
arrowHB.SetActive(true);
}
if(numberImage == 10){
header.text = "Mise au point : Position du laser";
header2.text = "Mise au point : Position du laser";
arrowHB.SetActive(false);
arrowXY.SetActive(true);
}
if(numberImage == 11){
header.text = "Procédure sur ordinateur";
header2.text = "Procédure sur ordinateur";
arrowXY.SetActive(false);
arrowPause.SetActive(false);
}
if(numberImage == 12){
header.text = "Suivre la découpe";
header2.text = "Suivre la découpe";
arrowPause.SetActive(true);
}
}
@@ -142,7 +156,9 @@ public class SwipeManagementScript : MonoBehaviour
SetImageStep();
}else{
textSteps.text = lengths[numberImage].text;
textSteps2.text = lengths[numberImage].text;
textNumber.text = "Step" + (numberImage+1) + "/" + (lengthTexts+1);
textNumber2.text = "Step" + (numberImage+1) + "/" + (lengthTexts+1);
}
}
}
@@ -165,7 +181,9 @@ public class SwipeManagementScript : MonoBehaviour
SetImageStep();
}else{
textSteps.text = lengths[numberImage].text;
textSteps2.text = lengths[numberImage].text;
textNumber.text = "Step" + (numberImage+1) + "/" + (lengthTexts+1);
textNumber2.text = "Step" + (numberImage+1) + "/" + (lengthTexts+1);
}
}
}
@@ -181,7 +199,9 @@ public class SwipeManagementScript : MonoBehaviour
private void SetImageStep(){
textSteps.text = "";
textSteps2.text = "";
textNumber.text = "Step" + (numberImage+1) + "/" + (lengthTexts+1);
textNumber2.text = "Step" + (numberImage+1) + "/" + (lengthTexts+1);
image = GameObject.Find("Image"+ numberImage);
imageUI = image.GetComponent<Image>();
imageUI.enabled = true;

View File

@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIRotation : MonoBehaviour
{
public GameObject canvas1;
public GameObject canvas2;
public GameObject stepup1;
public GameObject card1;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(Input.deviceOrientation == DeviceOrientation.LandscapeLeft || Input.deviceOrientation == DeviceOrientation.LandscapeRight) {
canvas1.SetActive(false);
canvas2.SetActive(true);
} else if(Input.deviceOrientation == DeviceOrientation.Portrait) {
canvas1.SetActive(true);
card1.SetActive(true);
stepup1.SetActive(false);
canvas2.SetActive(false);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fb7cf8eb89ab2f04abd56e9f96fcc1d5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: