Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        rb            = GetComponent <Rigidbody>();
        moved         = chose();
        currentHealth = 100;
        healthBar.SetMaxHealth(maxHealth);
        particles = GetComponentInChildren <ParticleSystem>();
        particles.Stop();


        //  transform.rotation = Quaternion.LookRotation(moved);
    }
Exemple #2
0
    // Start is called before the first frame update
    void Start()
    {
        rb            = GetComponent <Rigidbody>();
        moved         = chose();
        currentHealth = 100;
        healthBar.SetMaxHealth(maxHealth);
        particles = GetComponentInChildren <ParticleSystem>();
        particles.Stop();
        cannons = GameObject.Find("OsledShip(Clone)/PirateShip(Clone)/Lookout/Sphere").GetComponent <Lookoutosled>();

        textdeath = GameObject.Find("OsledShip(Clone)/PirateShip(Clone)/Canvas/death/deathcount").GetComponent <Text>();

        _distanitionG = GameObject.FindWithTag("Health").transform;
        _distanitionB = GameObject.FindWithTag("Ammo").transform;

        //  transform.rotation = Quaternion.LookRotation(moved);
    }
Exemple #3
0
 // on start the ship collects data for the ship rigidbody and  the health and ammo items and sets health to be 100
 void Start()
 {
     items[0]      = GameObject.Find("bottleLarge (1)");
     items[1]      = GameObject.Find("bottle (1)");
     items[2]      = GameObject.Find("bottleLarge");
     items[3]      = GameObject.Find("bottle");
     rb            = GetComponent <Rigidbody>();
     moved         = chose();
     currentHealth = 100;
     healthBar.SetMaxHealth(maxHealth);
     // get partical effect and set it to disabled
     particles = GetComponentInChildren <ParticleSystem>();
     particles.Stop();
     // get how many cannons the ship carries from LookOut script
     cannons = GameObject.Find("OsledShip(Clone)/PirateShip(Clone)/Lookout/Sphere").GetComponent <Lookoutosled>();
     // get the text canvas to input the death and kills gotten
     textdeath = GameObject.Find("OsledShip(Clone)/PirateShip(Clone)/Canvas/death/deathcount").GetComponent <Text>();
     // set a distanation of ammo and health
     _distanitionG = GameObject.FindWithTag("Health").transform;
     _distanitionB = GameObject.FindWithTag("Ammo").transform;
 }