Beispiel #1
0
 void Start()
 {
     rgbody2D  = GetComponent <Rigidbody2D>();
     spawnNode = this.gameObject.transform.Find("spawnNode").gameObject.GetComponent <Transform>();
     gcScript  = GameObject.Find("GameController").GetComponent <gameControllerScriptNew>();
     awayTime  = 1f;
     hScript   = this.gameObject.GetComponent <healthScript>();
 }
Beispiel #2
0
 private void Awake()
 {
     gm             = FindObjectOfType <ManageGame>();
     healthScript   = FindObjectOfType <healthScript>();
     scoreScript    = FindObjectOfType <score>();
     meteorSpeed    = gm.meteorSpeed;
     meteorLifespan = gm.meteorLifespan;
 }
Beispiel #3
0
    void OnTriggerEnter(Collider co)
    {
        healthScript health = co.GetComponentInChildren <healthScript>();

        if (health)
        {
            health.decrease();
            Destroy(gameObject);
        }
    }
    void Start()
    {
        animation          = GetComponent <Animation>();
        characterObject    = GameObject.Find("Knight");
        characterRigidbody = GetComponent <Rigidbody>();

        BreathScript    = breathBar.GetComponent <breathScript>();
        HealthScript    = healthBar.GetComponent <healthScript>();
        responseScript  = responseScreen.GetComponent <TypeOutScript>();
        audios          = characterObject.GetComponents <AudioSource>();
        rend            = characterObject.GetComponent <Renderer>();
        escapeTransform = escapeZone.GetComponent <Transform>();
        walking         = audios[0];
        running         = audios[1];
        damagetaken     = audios[2];
    }
Beispiel #5
0
    // Start is called before the first frame update
    void Start()
    {
        AudioSource[] audios = GetComponents <AudioSource>();
        itemPickup   = audios[0];
        animalAttack = audios[1];
        deathAudio   = audios[2];

        //pSys.Stop();
        hearts           = GameObject.Find("HealthBar").GetComponent <healthScript>();
        meatStockCounter = GameObject.Find("MeatStock Counter").GetComponent <meatStockUI>();

        extraJumps = extraJumpsValue;
        rb         = GetComponent <Rigidbody2D>();
        //UpdateHealth();
        currentHealth = maxHealth;
        //hearts.SetMaxHealth(maxHealth);
        //meatStockCounter.SetMeatStock(meatStock);
        deathMenuUI.SetActive(false);
    }
    public void LoadPlayer()
    {
        clickSound = GetComponent <AudioSource>();
        clickSound.Play();
        PlayerData       data = SaveSystem.LoadPlayer();
        playerController pCon = GameObject.FindGameObjectWithTag("Player").GetComponent <playerController>();
        GameObject       gO   = GameObject.FindGameObjectWithTag("Player");

        //Debug.Log(data.meatStock);
        pCon.meatStock        = data.meatStock;
        pCon.upgradeToken     = data.upgradeToken;
        pCon.maxHealth        = data.maxHealth;
        pCon.curLevelUnlocked = data.mapLevel;
        pCon.ResetHP();

        healthScript hScript = GameObject.Find("HealthBar").GetComponent <healthScript>();

        hScript.SetMaxHealth(data.maxHealth);
    }
Beispiel #7
0
 void Awake()
 {
     instance = this;
 }
Beispiel #8
0
 // Start is called before the first frame update
 void Start()
 {
     rgbody2D = GetComponent <Rigidbody2D>();
     gcScript = GameObject.Find("GameController").GetComponent <gameControllerScriptNew>();
     hScript  = GetComponent <healthScript>();
 }
Beispiel #9
0
 // Use this for initialization
 void Start()
 {
     health    = 100;
     healthBar = greenBar.GetComponent <healthScript>();
 }
Beispiel #10
0
 // Start is called before the first frame update
 void Start()
 {
     newText = GetComponent <Text>();
     health  = 3;
     S2      = this;
 }
 private void Awake()
 {
     healthScript = FindObjectOfType <healthScript>();
     scoreScript  = FindObjectOfType <score>();
     gm           = FindObjectOfType <ManageGame>();
 }