コード例 #1
0
ファイル: LepszySkok.cs プロジェクト: leTrollePL/SurviveWell
 public void betterjumpWhite()
 {
     if (white.GetComponent <PlayerMoney>().currentMoney() >= 100 && white.betterjump == false)
     {
         white.GetComponent <PlayerMoney>().SubbMoney(100);
         white.betterjump = true;
     }
     else
     {
         Debug.Log("brak hajsu");
     }
 }
コード例 #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.name == "White")
        {
            white.GetComponent <PlayerMoney>().addMoney(dropValue);
            Destroy(gameObject);
        }

        if (collision.gameObject.name == "Black")
        {
            black.GetComponent <PlayerMoney>().addMoney(dropValue);
            Destroy(gameObject);
        }
    }
コード例 #3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.name == "White")
        {
            var health = white.GetComponent <Health>();
            health.DealDamage(demage);
            Destroy(gameObject);
        }

        if (collision.gameObject.name == "Black")
        {
            var health = black.GetComponent <Health>();
            health.DealDamage(demage);
            Destroy(gameObject);
        }
        if (collision.gameObject.tag == "kolce")
        {
            Destroy(gameObject);
        }
        if (collision.gameObject.tag == "KosaDestroyer")
        {
            Destroy(gameObject);
        }
    }
コード例 #4
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        //if (health.currentHealth < health.maxHealth)
        //{

        //}
        //black
        if (collision.gameObject.layer == 10)
        {
            Destroy(gameObject);
            zycie = black.GetComponent <Health>().AktualneHP();
            black.GetComponent <Health>().odnowienieHP(20);
        }
        //white
        if (collision.gameObject.layer == 9)
        {
            Destroy(gameObject);
            zycie = white.GetComponent <Health>().AktualneHP();
            white.GetComponent <Health>().odnowienieHP(20);
        }
    }
コード例 #5
0
 void Update()
 {
     currentHP    = white.GetComponent <Health>().AktualneHP();
     slider.value = currentHP;
 }
コード例 #6
0
 // Update is called once per frame
 void Update()
 {
     score            = white.GetComponent <PlayerMoney>().currentMoney();
     textdisplay.text = score.ToString();
     // score = player.GetComponents<PlayerMoney>().
 }