using System.Linq; using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; public class OPEN_CLOSE : MonoBehaviour { static bool ROTATE_L; static bool ROTATE_R; static bool ROTATE_U; static bool ROTATE_D; int SENS; int NumberOfDoor; public static void Stop(){ ROTATE_L=false; ROTATE_R=false; ROTATE_U=false; ROTATE_D=false; } void Update() { for(int i=1; i=90 ) { if(SENS==1){Door.transform.rotation= Quaternion.Euler(0,90,0);} if(SENS==-1){ RefixAllDors(); } ROTATE_L=false; } }//End void DOORRotate_R(GameObject Door,GameObject Pivot,Vector3 Axe){ Door.transform.RotateAround(Pivot.transform.position, Axe*SENS, 50 * Time.deltaTime); if(Door.transform.rotation.eulerAngles.y<=270 ){ if(SENS==1){Door.transform.rotation= Quaternion.Euler(0,270,0);} if(SENS==-1){ RefixAllDors(); } ROTATE_R=false; } }//End void DOORRotate_U(GameObject Door,GameObject Pivot,Vector3 Axe) { Door.transform.RotateAround(Pivot.transform.position, Axe*SENS, 50 * Time.deltaTime); if(Door.transform.localEulerAngles.x>=90 || Door.transform.localEulerAngles.y>=180 ){ if(SENS==1){Door.transform.rotation = Quaternion.Euler(90,0,0);} if(SENS==-1){ RefixAllDors();} ROTATE_U=false; } }//End void DOORRotate_D(GameObject Door,GameObject Pivot,Vector3 Axe){ Door.transform.RotateAround(Pivot.transform.position, Axe*SENS, 50 * Time.deltaTime); if(Door.transform.localEulerAngles.x<=270 || Door.transform.localEulerAngles.y>=180 ){ if(SENS==1){Door.transform.rotation = Quaternion.Euler(-90,0,0);} if(SENS==-1){ RefixAllDors();} ROTATE_D=false; } } public void RefixAllDors(){ for(int i=1; i().isOn; //print("_G.Selected======"+_G.SELECTED+" "+OC); GameObject T=gameObject.transform.Find("Text").gameObject; int nO=Get.GetObjectIndex(SceneModeManager.SelectedName); if(OC==true){ T.transform.GetComponent().text=TRANS.This("C_Open"); T.transform.localPosition=new(-12,0,0); Open(nO); } else{ T.transform.GetComponent().text=TRANS.This("C_Close"); T.transform.localPosition=new(12,0,0); Close(nO); } NumberOfDoor = (_G.OBJs[nO][25].Split('_').Length - 2) / 4; } public void Open(int nO){ if(SceneModeManager.SelectedName.IndexOf("cabi")!=-1 ){ //print("_G.SELECTED==========="+_G.SELECTED); SENS=1; ROTATE_L=true; ROTATE_R=true; ROTATE_U=true; ROTATE_D=true; } } public void Close(int nO){ if(SceneModeManager.SelectedName.IndexOf("cabi")!=-1 ){ SENS=-1; ROTATE_L=true; ROTATE_R=true; ROTATE_U=true; ROTATE_D=true; } } }