コード例 #1
0
ファイル: Player.cs プロジェクト: p23he/Geometris-2.0
    // Start is called before the first frame update
    void Start()
    {
        Speed         = 5;
        Health        = 5;
        BulletPowerUp = PowerUp.BulletPowerUp.None;
        PlayerPowerUp = PowerUp.PlayerPowerUp.None;
        InstantiateHealthbar();
        Debug.Log("Game started.");
        transform.position = new Vector2(0, -4);

        Score = 0;

        // Iterate over powerup enum and map each prefab with each powerup
        int i = 0;

        foreach (BulletType bullet in BulletType.GetValues(typeof(PowerUp.BulletPowerUp)))
        {
            if (i >= bulletPrefabs.Count)
            {
                break;
            }
            bulletMap.Add(bullet, bulletPrefabs[i]);
            i++;
        }
    }