Created
January 20, 2017 21:46
-
-
Save uruskan/44ef301812ae0d51497eaabc980003c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
// 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); | |
} | |
if (simdikiCan > 0) { | |
Debug.Log(simdikiCan +"Canım Kaldı."); | |
} | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment