Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class Can : MonoBehaviour {
- public int hp = 100;
- public int simdikiCan;
- public Slider hpslider;
- public GameObject rpgci;
- // Use this for initialization
- void Start () {
- }
- public void hasarAl(int saldırıGücü) {
- simdikiCan = hp - saldırıGücü;
- hp = simdikiCan;
- hpslider.value = simdikiCan;
- if (simdikiCan <= 0) {
- Debug.Log("Öldüm Çıktım !");
- Destroy(gameObject);
- rpgci.SetActive(false);
- }
- if (simdikiCan > 0) {
- Debug.Log(simdikiCan +"Canım Kaldı.");
- }
- }
- // Update is called once per frame
- void Update () {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement