// Use this for initialization void Start() { timer = time; scoreText = GameObject.Find("Score").GetComponent <Text>(); scoreText.text = score + string.Empty; tips = GameObject.Find("Score").GetComponent <tooltips>(); }
//public Scri // Use this for initialization void Start() { mTimer = mTime; sTimer = sTime; moneten = GameObject.Find("MainLogic").GetComponent <Money>(); score = GameObject.Find("MainLogic").GetComponent <scorer>(); mpt = GameObject.Find("Money").GetComponent <tooltips>(); spt = GameObject.Find("Score").GetComponent <tooltips>(); }
public void Autoplay(string file, tooltips _t) { videoSurface.material.SetColor("_TintColor", new Color32(0x9A, 0x9A, 0x9A, 0x80)); _tooltip = _t; vidFilename = file; togglePlay(); vidUI.updateControlQuad(); vidUI.controlQuad.SetActive(false); vidUI.controlRends[0].material.SetFloat("_EmissionGain", 0f); }
// Use this for initialization void Start() { ownedText = GameObject.Find("SimOwned").GetComponent <Text>(); buySim = GameObject.Find("SimButton").GetComponent <Button>(); shop = GameObject.Find("MainLogic").GetComponent <ShopStuff>(); buySim.onClick.AddListener(Buy); buttonTooltip = buySim.GetComponent <tooltips>(); cash = GameObject.Find("MainLogic").GetComponent <Money>(); buttonTooltip.tooltipText = "Increases score per tick by 1, Price: " + price; ownedText.text = owned + string.Empty; }
public GameObject Setup(deviceType d) { item = d; tex = Resources.Load("Textures/" + item.ToString() + "Symbol") as Texture; symbol.material.SetTexture("_MainTex", tex); itemPrefab = Resources.Load("Prefabs/" + item.ToString()) as GameObject; label.text = item.ToString(); if (item == deviceType.Valve) { label.text = "Gate"; } if (item == deviceType.MIDIIN) { label.text = "MIDI IN"; } if (item == deviceType.MIDIOUT) { label.text = "MIDI OUT"; } if (item == deviceType.Sequencer) { label.text = "Drum Machine"; } if (item == deviceType.Timeline) { label.text = "Sequencer"; } label.gameObject.SetActive(false); symbol.gameObject.SetActive(false); GameObject g = Instantiate(itemPrefab, transform.position, transform.rotation) as GameObject; g.transform.parent = transform; manager = transform.parent.parent.GetComponent <menuManager>(); Vector3 size = Vector3.zero; Vector3 center = Vector3.zero; if (item == deviceType.Sequencer) { for (int i = 0; i < 2; i++) { for (int i2 = 0; i2 < 4; i2++) { GameObject cube = Instantiate(g.GetComponent <sequencerDeviceInterface>().touchCubePrefab, transform.position, transform.rotation) as GameObject; cube.transform.parent = g.transform; cube.transform.Translate(Vector3.right * i2 * -.04f, Space.Self); cube.transform.Translate(Vector3.up * i * -.04f, Space.Self); } GameObject seq = Instantiate(g.GetComponent <sequencerDeviceInterface>().samplerPrefab, transform.position, transform.rotation) as GameObject; seq.transform.parent = g.transform; seq.transform.Translate(Vector3.right * .081f, Space.Self); seq.transform.Translate(Vector3.up * i * -.04f, Space.Self); } Destroy(g.transform.Find("stretchNode").gameObject); } if (item == deviceType.Tapes) { GameObject tape = Instantiate(g.GetComponent <libraryDeviceInterface>().tapePrefab, transform, false) as GameObject; Destroy(g); g = tape; } if (item == deviceType.Timeline) { GameObject tl = Instantiate(Resources.Load("Prefabs/timelineRep") as GameObject, transform, false) as GameObject; Destroy(g); g = tl; } MonoBehaviour[] m = g.GetComponentsInChildren <MonoBehaviour>(); for (int i = 0; i < m.Length; i++) { Destroy(m[i]); } AudioSource[] audios = g.GetComponentsInChildren <AudioSource>(); for (int i = 0; i < audios.Length; i++) { Destroy(audios[i]); } Rigidbody[] rig = g.GetComponentsInChildren <Rigidbody>(); for (int i = 0; i < rig.Length; i++) { Destroy(rig[i]); } Renderer[] r = g.GetComponentsInChildren <Renderer>(); for (int i = 0; i < r.Length; i++) { r[i].material = menuMat; if (r[i].bounds.size.sqrMagnitude > size.sqrMagnitude) { size = r[i].bounds.size; center = r[i].bounds.center; } } Collider[] c = g.GetComponentsInChildren <Collider>(); for (int i = 0; i < c.Length; i++) { Destroy(c[i]); } tooltips t = GetComponentInChildren <tooltips>(); if (t != null) { Destroy(t.gameObject); } g.tag = "Untagged"; g.transform.localScale = g.transform.localScale / (size.magnitude * 20); g.transform.localPosition = g.transform.localPosition + Vector3.forward * .02f; if (item == deviceType.Maracas) { g.transform.localPosition = new Vector3(0, -.02f, .02f); } if (item == deviceType.Camera) { g.transform.localRotation = Quaternion.Euler(90, 0, 0); Camera[] cams = g.GetComponentsInChildren <Camera>(); for (int i = 0; i < cams.Length; i++) { Destroy(cams[i].gameObject); } Destroy(g.transform.Find("screenFrame").gameObject); } if (item == deviceType.Realview) { g.transform.localRotation = Quaternion.Euler(0, 180, 0); } if (item == deviceType.Keyboard) { g.transform.localPosition = new Vector3(0.013f, 0, .026f); g.transform.localScale = Vector3.one * .08f; Destroy(g.transform.Find("KeyboardTimeline").gameObject); } if (item == deviceType.XyloRoll) { g.transform.localPosition = new Vector3(.0239f, 0, .02f); g.transform.localScale = Vector3.one * .087f; g.transform.localRotation = Quaternion.Euler(34, 0, 0); Destroy(g.transform.Find("KeyboardTimeline").gameObject); Destroy(g.transform.Find("OscillatorBank").gameObject); Destroy(g.transform.Find("ADSR").gameObject); } if (item == deviceType.MIDIOUT) { Destroy(g.transform.Find("CChandle").gameObject); Destroy(g.transform.Find("NOTEhandle").gameObject); } if (item == deviceType.Airhorn) { g.transform.localPosition = new Vector3(-0.005f, -.018f, 0.02f); g.transform.localRotation = Quaternion.Euler(0, 90, 0); g.transform.localScale = Vector3.one * .14f; } if (item == deviceType.Tapes) { g.transform.localPosition = new Vector3(0, 0, 0.02f); g.transform.localRotation = Quaternion.Euler(0, 0, 0); } if (item == deviceType.Timeline) { g.transform.localPosition = new Vector3(0, 0, 0.02f); g.transform.localRotation = Quaternion.Euler(0, 0, 0); } if (item == deviceType.Filter) { g.transform.localPosition = new Vector3(.015f, 0, .02f); g.transform.localRotation = Quaternion.Euler(0, 180, 0); } if (item == deviceType.Splitter) { g.transform.localPosition = new Vector3(.0185f, 0, .02f); } if (item == deviceType.Sequencer) { g.transform.localScale = Vector3.one * .166f; } if (item == deviceType.ControlCube) { g.transform.localPosition = new Vector3(0, -.01f, .024f); } if (item == deviceType.Reverb) { g.transform.localPosition = new Vector3(0, -0.0175f, .02f); } if (item == deviceType.Drum) { g.transform.localPosition = new Vector3(0, 0, .026f); g.transform.localRotation = Quaternion.Euler(40, 0, 0); } if (item == deviceType.Mixer) { g.transform.localPosition = new Vector3(0.014f, 0, .02f); g.transform.localRotation = Quaternion.Euler(60, 0, 0); } return(g); }