Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class zmianapter : MonoBehaviour
- {
- public Material greenMaterial;
- public Material grayMaterial;
- public GameObject parter;
- public GameObject pierwsze;
- public GameObject drugie;
- public string t;
- public int pt;
- public GameObject nv_0;
- public GameObject nv_1;
- public GameObject nv_2;
- //public GameObject nv_3;
- private GameObject[] navpart;
- private GameObject[] navp1;
- private GameObject[] navpl2;
- public GameObject schody;
- private Vector3 pos0;
- private Vector3 pos1;
- private Vector3 pos2;
- void Start()
- {
- parter.SetActive(true);
- pierwsze.SetActive(false); //parter
- drugie.SetActive(false);
- pt = 0; //parter
- //
- //navpart = GameObject.FindGameObjectsWithTag("parter");
- //navp1 = GameObject.FindGameObjectsWithTag("1 pt");
- //navpl2 = GameObject.FindGameObjectsWithTag("2 pt");
- //foreach (GameObject n in navp1)
- //{
- // pos0 = n.transform.position;
- // n.transform.position = schody.transform.position;
- //}
- //foreach (GameObject n in navpart)
- //{
- // pos1 = n.transform.position;
- //}
- //foreach (GameObject n in navpl2)
- //{
- // pos2 = n.transform.position;
- //}
- //foreach (GameObject n in navpl2)
- //{
- // n.transform.position = schody.transform.position;
- //}
- }
- // Update is called once per frame
- void Update()
- {
- //if (pt == 0)
- //{
- // nv_1.SetActive(false);
- // nv_2.SetActive(false);
- // nv_0.SetActive(true);
- //}
- //else if (pt == 1)
- //{
- // nv_1.SetActive(true);
- // nv_2.SetActive(false);
- // nv_0.SetActive(false);
- //}
- //else if (pt == 2)
- //{
- // nv_1.SetActive(false);
- // nv_2.SetActive(true);
- // nv_0.SetActive(false);
- //}
- //if (pt == 0)
- //{
- // foreach (GameObject s in GameObject.FindGameObjectsWithTag("prt") )
- // {
- // s.SetActive(false);
- // }
- //}
- //else if (pt == 1)
- //{
- // foreach (GameObject s in GameObject.FindGameObjectsWithTag("1sze"))
- // {
- // s.SetActive(false);
- // }
- //}
- //else if (pt == 2)
- //{
- // foreach (GameObject s in GameObject.FindGameObjectsWithTag("2gie"))
- // {
- // s.SetActive(false);
- // }
- //}
- }
- public void Strepsils(string nw)
- {
- if (nw == parter.name)
- {
- parter.SetActive(true);
- pierwsze.SetActive(false);
- drugie.SetActive(false);
- }
- else if (nw == pierwsze.name)
- {
- parter.SetActive(false);
- pierwsze.SetActive(true);
- drugie.SetActive(false);
- }
- else if (nw == drugie.name)
- {
- parter.SetActive(false);
- pierwsze.SetActive(false);
- drugie.SetActive(true);
- }
- }
- public void Strepsilsnr(int ptnr)
- {
- pt = ptnr;
- schody.GetComponent<Renderer> ().material = grayMaterial;
- if (pt == 0)
- parter.transform.GetChild(0).GetComponent<Renderer> ().material = greenMaterial;
- if (pt == 1)
- pierwsze.transform.GetChild (0).GetComponent<Renderer> ().material = greenMaterial;
- if (pt == 2)
- drugie.transform.GetChild (0).GetComponent<Renderer> ().material = greenMaterial;
- // if (pt == 0)
- // {
- // foreach (GameObject n in navpart)
- // {
- // n.transform.position = pos0;
- // }
- // foreach(GameObject n in navp1)
- // {
- // n.transform.position = schody.transform.position;
- // }
- // foreach (GameObject n in navpl2)
- // {
- // n.transform.position = schody.transform.position;
- // }
- // }
- // if (pt == 1)
- // {
- // foreach (GameObject n in navpart)
- // {
- // n.transform.position = schody.transform.position;
- // }
- // foreach (GameObject n in navp1)
- // {
- // n.transform.position = pos2;
- // }
- // foreach (GameObject n in navpl2)
- // {
- // n.transform.position = schody.transform.position;
- // }
- // }
- // if (pt == 2)
- // {
- // foreach (GameObject n in navpl2)
- // {
- // n.transform.position = pos2;
- // }
- // foreach (GameObject n in navpart)
- // {
- // n.transform.position = schody.transform.position;
- // }
- // foreach (GameObject n in navp1)
- // {
- // n.transform.position = schody.transform.position;
- // }
- // }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement