Пример #1
0
    // Use this for initialization
    void Start()
    {
        level = 1;

        levelStart = false;
        paused     = true;

        spawner = GameObject.FindGameObjectWithTag("MobSpawn").GetComponent <MobSpawner>();
        mvmt    = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement> ();
        tFire   = GameObject.FindGameObjectWithTag("Bow").GetComponent <TurretFire> ();

        spawner.enabled = false;
        mvmt.enabled    = false;
        tFire.enabled   = false;

        spawnerObj = GameObject.FindGameObjectWithTag("MobSpawn");
        tFireObj   = GameObject.FindGameObjectWithTag("Bow");


        play = gameObject.GetComponentInChildren <Text> ();

        //skelesMax = 2;

        playButton.onClick.AddListener(Play);
    }
Пример #2
0
 void Start()
 {
     turretScript = GameObject.FindGameObjectWithTag("Turret").GetComponent <TurretFire>();
     bulletBody   = GetComponent <Rigidbody2D>();
     speed        = turretScript.shotSpeed;
     direction    = transform.up;
     Destroy(gameObject, 10f);
 }
Пример #3
0
 // Give bullet prefab a tag and type in the name of tag on inspecter
 // Use this for initialization
 void Start()
 {
     ani                  = GetComponent <Animator> ();
     turretFire           = GetComponentInChildren <TurretFire> ();
     turretFire.fireDelay = fireDelay;
     turretFire.fireRate  = fireRate;
     turretFire.bulletTag = bulletTag;
     //fireDelay = turretFire.fireDelay;
     //fireRate = turretFire.fireRate;
     //bulletTag = turretFire.bulletTag;
 }