void Start()
    {
        spawnController = GameObject.Find("Spawner").GetComponent<Spawner_Script>();
        distanceController = GameObject.Find("_DistanceController").GetComponent<DistanceController>();
        fadeController = GameObject.Find("Fader").GetComponent<FadeInOut>();
        gameOver = GameObject.Find("GameOver").GetComponent<GameOver>();

        Invoke("stageStart", 0.25f);
        Invoke("startGame", 3.0f);
    }
Пример #2
0
    void Start()
    {
        spawnController    = GameObject.Find("Spawner").GetComponent <Spawner_Script>();
        distanceController = GameObject.Find("_DistanceController").GetComponent <DistanceController>();
        fadeController     = GameObject.Find("Fader").GetComponent <FadeInOut>();
        gameOver           = GameObject.Find("GameOver").GetComponent <GameOver>();

        Invoke("stageStart", 0.25f);
        Invoke("startGame", 3.0f);
    }
Пример #3
0
	// Use this for initialization
	void Start () {
        hitColliders = Physics.OverlapSphere(transform.position, Spawner_Check_Range, SpawnerCheckLayer);
        if (hitColliders.Length != 0)
        {
            for (array_index = 0; array_index < hitColliders.Length; array_index++)
            {
                spawner_script = hitColliders[array_index].GetComponent<Spawner_Script>();
                spawner_script.Spawner_Enable = false;
            }
        }
	}
Пример #4
0
	// Update is called once per frame
    void Update()
    {

            //Rotate Player Towards the Mouse_Pos
            Mouse_Pos = MainCamera.ScreenToWorldPoint(Input.mousePosition);
            Mouse_Pos.y = 10;
            transform.LookAt(Mouse_Pos, Vector3.up);

            //Move Player with WASD
            /*
            if (Input.GetButton("Horizontal"))
            {
                transform.Translate(Vector3.right * Move_Speed * Input.GetAxisRaw("Horizontal"), Space.Self);
            }*/
            if (Input.GetButton("Vertical"))
            {
                transform.Translate(Vector3.forward * Move_Speed * Input.GetAxisRaw("Vertical"), Space.Self);
            }

            //Attack with Left_Click
            if (Input.GetButtonDown("Fire1"))
            {
                Player_Animator.SetBool("Attack", true);
            }
            CheckForFires();
            enemyhisColliders = Physics.OverlapSphere(this.transform.position, 80, EnemyCheckLayer);
            if (enemyhisColliders.Length != 0)
            {
                for (array_index = 0; array_index < enemyhisColliders.Length; array_index++)
                {
                    if (enemyhisColliders[array_index].tag == "Dragon")
                    {

                    }
                    else
                    {
                        enemy = enemyhisColliders[array_index].GetComponent<Enemy1_Script>();
                        enemy.Activate();
                    }
                }
            }
            spawnerhisColliders = Physics.OverlapSphere(this.transform.position, 80, SpawnerCheckLayer);
            if (spawnerhisColliders.Length != 0)
            {
                for (array_index = 0; array_index < spawnerhisColliders.Length; array_index++)
                {

                    spawner = spawnerhisColliders[array_index].GetComponent<Spawner_Script>();
                    spawner.Activate = true;
                }
            }
        
    }