예제 #1
0
        private void Start()
        {
            currentImage = GetComponent <Image>();
            pauseMenu    = FindObjectOfType <Pause.PauseMenu>();

            currentImage.color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
        }
예제 #2
0
        // Use this for initialization
        void Start()
        {
            pauseMenu = FindObjectOfType <Pause.PauseMenu>();

            res = Screen.currentResolution;

            switchTool(Tool.PLANK);
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
파일: Game.cs 프로젝트: JakeP121/Plug-Em-Up
        // 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;
        }
예제 #5
0
        /// <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>();
        }
예제 #6
0
 private void Start()
 {
     pauseMenu = FindObjectOfType <Pause.PauseMenu>();
 }
예제 #7
0
        private void Start()
        {
            sprite = GetComponent <SpriteRenderer>();

            pauseMenu = FindObjectOfType <Pause.PauseMenu>();
        }