// Update is called once per frame void Update() { //touchPos = Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position); if (navManager.getCurrentTab() == 2) { //Mitochondria mitochondria.gameObject.SetActive(true); mitochondriaBuy.gameObject.SetActive(true); //mitochondriaInfo.gameObject.SetActive(true); mitochondriaDescription.gameObject.SetActive(true); buyShade.enabled = true; chloroplast.gameObject.SetActive(true); vacuole.gameObject.SetActive(true); test.gameObject.SetActive(true); } else { //Mitochondria mitochondria.gameObject.SetActive(false); mitochondriaBuy.gameObject.SetActive(false); //mitochondriaInfo.gameObject.SetActive(false); mitochondriaDescription.gameObject.SetActive(false); buyShade.enabled = false; chloroplast.gameObject.SetActive(false); vacuole.gameObject.SetActive(false); test.gameObject.SetActive(false); } if (itemIsSelected && navManager.getCurrentTab() == 1) { buyMode = true; } if (buyMode) { placeText.gameObject.SetActive(true); if (isTouched) { Instantiate(mitochondriaPrefab, placeToPut, Quaternion.identity); amountSelected--; isTouched = false; } if (amountSelected == 0) { buyMode = false; itemIsSelected = false; itemSelected = ""; amountSelected = 0; } //Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position) } else { placeText.gameObject.SetActive(false); } }
// Update is called once per frame void Update() { if (navManager.getCurrentTab() == tabToSelectOn) { spriteRend.sprite = active; } else { spriteRend.sprite = notActive; } }
// Update is called once per frame void Update() { if (navigationManager.getCurrentTab() == tabToActivate) { spriteRend.sprite = active; } else { spriteRend.sprite = notActive; } }
// Update is called once per frame void Update() { if (navigationManager.getCurrentTab() == tabToShowOn) { GetComponent <SpriteRenderer>().enabled = true; } else { GetComponent <SpriteRenderer>().enabled = false; } }