04.07.2022

This commit is contained in:
Plotnikov
2022-07-04 13:15:35 +03:00
parent 5fad2bcf6b
commit 696daa0b2e
7224 changed files with 3814576 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class ButtonCubik : MonoBehaviour
{
public GameObject[] view;
public bool curView = true; // v1
Manager man;
void Start()
{
//Debug.Log("Cube start");
curView = true;
view[0].SetActive(curView);
view[1].SetActive(!curView);
man = GameObject.Find("Manager").GetComponent<Manager>();
}
public void Clicked()
{
if (man.mode == "scedit") return;
ChangeView();
}
public void ChangeView()
{
curView = !curView;
view[0].SetActive(curView);
view[1].SetActive(!curView);
if(man == null) man = GameObject.Find("Manager").GetComponent<Manager>();
man.objects.Find(this.gameObject.name).curState = curView ? 0 : 1;
}
public void SetView(int newView=-1)
{
//Debug.Log("SetView " + newView);
if (newView == 0) curView = true;
if (newView == 1) curView = false;
view[0].SetActive(curView);
view[1].SetActive(!curView);
if (man == null) man = GameObject.Find("Manager").GetComponent<Manager>();
man.objects.Find(this.gameObject.name).curState = newView;
}
}