コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        Physics2D.IgnoreLayerCollision(8, 11, true);

        p1Health p1h = p1.GetComponent <p1Health> ();
        p2Health p2h = p2.GetComponent <p2Health> ();


        p1HealthTrack = p1h.currentHealth;
        p2HealthTrack = p2h.currentHealth;



        if (p1HealthTrack <= 0 && p2HealthTrack > 0)
        {
            Debug.Log("Player 2 Wins");

            StoreName.loserName = StoreName.player1inCombat;

            BoardController.instance.currentState = States.RESTORE;
            Load();
        }
        else if (p2HealthTrack <= 0 && p1HealthTrack > 0)
        {
            Debug.Log("Player 1 Wins");

            StoreName.loserName = StoreName.player2inCombat;

            BoardController.instance.currentState = States.RESTORE;
            Load();
        }
    }
コード例 #2
0
ファイル: P1LLBoost.cs プロジェクト: ezoran/Project-Space
 void Update()
 {
     p1health = p1.GetComponent <p1Health> ();
     p2health = p2.GetComponent <p2Health> ();
 }