private void Start() { currentImage = GetComponent <Image>(); pauseMenu = FindObjectOfType <Pause.PauseMenu>(); currentImage.color = new Color(1.0f, 1.0f, 1.0f, 0.0f); }
// Use this for initialization void Start() { pauseMenu = FindObjectOfType <Pause.PauseMenu>(); res = Screen.currentResolution; switchTool(Tool.PLANK); }
/// <summary> /// Initialises the plank /// </summary> /// <param name="parent">Transform of hole to place this plank on top of.</param> public void init(Transform parent) { currentState = State.BUILDING; mouse = FindObjectOfType <Mouse>(); mouse.switchTool(Mouse.Tool.HAMMER); pauseMenu = FindObjectOfType <Pause.PauseMenu>(); transform.SetParent(parent); transform.localPosition = new Vector3(0.0f, 0.0f, parent.transform.position.z - 0.1f); key = transform.parent.GetComponent <Leak>().key; ring = transform.Find("Ring").gameObject.GetComponent <PulsingUI>(); clicksToBuild = Random.Range(1, 8); audioSource = GetComponent <AudioSource>(); playSoundFrom(placementSound); }
// Use this for initialization void Start() { grid = GetComponent <KeyboardGrid>(); pauseMenu = FindObjectOfType <Pause.PauseMenu>(); audioSource = GetComponent <AudioSource>(); audioSource.clip = explosionSound; GameObject hand = GameObject.Find("Hand"); fingers = new Finger[hand.transform.childCount]; for (int i = 0; i < hand.transform.childCount; i++) { fingers[i] = hand.transform.GetChild(i).GetComponent <Finger>(); } initBreakFrequencies(); running = true; }
/// <summary> /// Initialises the leak /// </summary> /// <param name="key">The key used to plug this hole</param> public void init(KeyboardKey key) { this.key = key; currentState = State.LEAKING; transform.position = key.position; game = FindObjectOfType <Game>(); pauseMenu = FindObjectOfType <Pause.PauseMenu>(); Score.newLeak(); waves = FindObjectOfType <Waves>(); hole = transform.Find("Hole").gameObject; hole.transform.rotation = Quaternion.Euler(0.0f, 0.0f, Random.Range(0.0f, 360.0f)); // Random orientation keyIcon = transform.Find("Key").gameObject; keyIcon.transform.Find("Text").GetComponent <TextMesh>().text = key.keyCode.ToString(); particleSystem = GetComponentInChildren <ParticleSystem>(); }
private void Start() { pauseMenu = FindObjectOfType <Pause.PauseMenu>(); }
private void Start() { sprite = GetComponent <SpriteRenderer>(); pauseMenu = FindObjectOfType <Pause.PauseMenu>(); }