Beispiel #1
0
 void Start()
 {
     isAlive = true;
     score = GameObject.FindGameObjectWithTag ("Score").GetComponent<Score> ();
     gameplayControls = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameplayControls>();
     soundControls = GameObject.FindGameObjectWithTag("SoundsController").GetComponent<SoundControls>();
 }
Beispiel #2
0
    /// <summary>
    /// Initialises several variables & city array.
    /// </summary>
    void Awake()
    {
        soundManager      = Camera.main.GetComponent <SoundControls>();
        timeSmallInterval = timeInterval / agentCalls;
        city = new GameObject[width, height]; //Create a grid for the city.

        for (int i = 0; i < width; i++)       //Begin city initialisation.
        {
            for (int j = 0; j < height; j++)
            {
                GameObject temp;

                temp = Instantiate(buildings[(int)EnumClass.BID.Empty]);

                city[i, j] = temp;
                temp.GetComponent <CityTile>().location = new int[2] {
                    i, j
                };

                Transform temp2 = temp.transform;

                temp2.parent   = gameObject.transform;
                temp2.position = temp2.position + new Vector3(2 * j, 0, 2 * i);
            }
        }
    }
Beispiel #3
0
    public void Start()
    {
        Player          = GameObject.FindGameObjectWithTag("Player");
        PlayerContainer = GameObject.FindGameObjectWithTag("PlayerContainer");
        soundControls   = GameObject.FindGameObjectWithTag("SoundsController").GetComponent <SoundControls>();
        menuPause.SetActive(false);
        menuGameOver.SetActive(false);
        tutorial.SetActive(false);

        if (!PlayerPrefs.HasKey("firstTime"))
        {
            PlayerPrefs.SetString("firstTime", "true");
        }
        isFirstTime = bool.Parse(PlayerPrefs.GetString("firstTime"));
        if (isFirstTime)
        {
            DoTutorial();
        }

        // Play independently of on or off, if volume is down no sound will be output
        if (isMusicOn)
        {
            MusicSound.GetComponent <AudioSource>().Play();
        }
    }
Beispiel #4
0
 void Start()
 {
     isAlive          = true;
     score            = GameObject.FindGameObjectWithTag("Score").GetComponent <Score> ();
     gameplayControls = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameplayControls>();
     soundControls    = GameObject.FindGameObjectWithTag("SoundsController").GetComponent <SoundControls>();
 }
Beispiel #5
0
    //private Vector3 temp;

    // Use this for initialization
    void Start()
    {
        soundControls = GameObject.FindGameObjectWithTag("SoundsController").GetComponent <SoundControls>();
        Spy           = GameObject.FindGameObjectWithTag("Player");
        SpyAnimator   = Spy.GetComponent <Animator> ();

        cracksLeftGenerator  = LeftCrackSet.GetComponent <GenerateCracks>();
        cracksRightGenerator = RightCrackSet.GetComponent <GenerateCracks>();

        soundControls.PlayClimbingSound();

        cracksLeftGenerator.StartCracks();

        //RunEffectLeft.SetActive(true);
        //RunEffectRight.SetActive(false);
        StartRunEffectLeft();
    }
Beispiel #6
0
    //private Vector3 temp;
    // Use this for initialization
    void Start()
    {
        soundControls = GameObject.FindGameObjectWithTag("SoundsController").GetComponent<SoundControls>();
        Spy = GameObject.FindGameObjectWithTag("Player");
        SpyAnimator = Spy.GetComponent <Animator> ();

        cracksLeftGenerator = LeftCrackSet.GetComponent<GenerateCracks>();
        cracksRightGenerator = RightCrackSet.GetComponent<GenerateCracks>();

        soundControls.PlayClimbingSound();

        cracksLeftGenerator.StartCracks();

        //RunEffectLeft.SetActive(true);
        //RunEffectRight.SetActive(false);
        StartRunEffectLeft();
    }
Beispiel #7
0
 /// <summary>
 /// Initialise variables
 /// </summary>
 public void Awake()
 {
     construction.SetActive(false);
     soundManager = Camera.main.GetComponent <SoundControls>();
 }
Beispiel #8
0
 // Use this for initialization
 void Start()
 {
     instance = this;
 }
    public void Start()
    {
        Player = GameObject.FindGameObjectWithTag("Player");
        PlayerContainer = GameObject.FindGameObjectWithTag("PlayerContainer");
        soundControls = GameObject.FindGameObjectWithTag("SoundsController").GetComponent<SoundControls>();
        menuPause.SetActive(false);
        menuGameOver.SetActive(false);
        tutorial.SetActive(false);

        if (!PlayerPrefs.HasKey ("firstTime")) {
            PlayerPrefs.SetString ("firstTime", "true");
        }
        isFirstTime = bool.Parse(PlayerPrefs.GetString("firstTime"));
        if (isFirstTime) {
            DoTutorial ();
        }

        // Play independently of on or off, if volume is down no sound will be output
        if(isMusicOn) MusicSound.GetComponent<AudioSource>().Play();
    }