Exemplo n.º 1
0
    void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.tag == "Player_Bullet")
        {
            //playershipBullet = GameObject.Find ("Bullet").GetComponent<Bullet>();

            TakeDamage(col.gameObject.GetComponent <Bullet>().playerDamage);

            print("ow");
        }

        if (col.gameObject.tag.Contains("Player_Ship"))
        {
            shipLife = GameObject.Find("playerShip").GetComponent <Player_HealthScript>();

            shipLife.TakeDamage(shipCollisionDmg);

            Destroy(gameObject);

            print("player hit!");
        }
    }
Exemplo n.º 2
0
    // Use this for initialization

    void Start()
    {
        damage = GameObject.Find("playerShip").GetComponent <Player_HealthScript>();
        target = GameObject.Find("playerShip").transform.position;
    }