コード例 #1
0
ファイル: GameManager.cs プロジェクト: a2choy/Run-and-Dodge
    public void Restart()
    {
        gameOverPanel.SetActive(false);
        score = 0;

        Destroy(player);
        player = Instantiate(players[n], pos, Quaternion.identity); //instantiate player on board and remember player

        float   curX     = minX;                                    //current x for heart loc
        Vector3 heartPos = new Vector3(curX + 0.5f, maxY - 0.5f, 0);

        for (int i = 0; i < script.health; i++) // set health on screen
        {
            GameObject tempLife = Instantiate(heart, heartPos, Quaternion.identity);
            lifePoints.Add(tempLife);
            curX    += 0.825f;
            heartPos = new Vector3(curX + 0.5f, maxY - 0.5f, 0);
        }

        Invoke("StartScore", 0); //start invoking points/time
        spawner.StartSpawning(startInterval);
    }
コード例 #2
0
 public void OnInstructionCardClick()
 {
     instructionsCard.SetActive(false);
     spaceChicken.gameObject.SetActive(true);
     spawner.StartSpawning();
 }