Exemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D otherCollider)
    {
        PlayerHealthDisplay playerLivesObj = FindObjectOfType <PlayerHealthDisplay>();

        playerLivesObj.DecreaseLives();
        Destroy(otherCollider.gameObject);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        playerHealth = PlayerHealth.Instance;

        this.gameObject.AddComponent<PlayerHealthDisplay>();
        healthDisplay = this.GetComponent<PlayerHealthDisplay>();

        //****** TODO ******//
        // MovePlayer - jump at least
        // Shoot at cat
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        playerHealth = PlayerHealth.Instance;

        this.gameObject.AddComponent<PlayerHealthDisplay>();
        healthDisplay = this.GetComponent<PlayerHealthDisplay>();

        audioSrc = GetComponent<AudioSource> ();
        audioSrc.clip = steam;
        audioSrc.Play();
    }
Exemplo n.º 4
0
    void Start()
    {
        float distance = transform.position.z - Camera.main.transform.position.z;

        var leftmost  = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, distance));
        var rightmost = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, distance));

        xmin = leftmost.x + padding;
        xmax = rightmost.x - padding;

        Debug.Log(leftmost.ToString());
        Debug.Log(rightmost.ToString());

        healthDisplay = GameObject.Find("Player Health Display").GetComponent <PlayerHealthDisplay>();
    }
Exemplo n.º 5
0
 private void Start()
 {
     health = FindObjectOfType <PlayerHealthDisplay>();
 }
Exemplo n.º 6
0
 void Start()
 {
     healthClass   = gameObject.GetComponent <PlayerHealth>();
     healthDisplay = gameObject.GetComponent <PlayerHealthDisplay>();
 }