------Update and install packages------
/__w/_temp/40c7e2e3-ed1a-4d0f-a8da-5f7bf062cb90.sh: line 6: sudo: command not found
/__w/_temp/40c7e2e3-ed1a-4d0f-a8da-5f7bf062cb90.sh: line 7: sudo: command not found
/__w/_temp/40c7e2e3-ed1a-4d0f-a8da-5f7bf062cb90.sh: line 8: sudo: command not found
------Initialize build environment------
/__w/_temp/40c7e2e3-ed1a-4d0f-a8da-5f7bf062cb90.sh: line 11: sudo: command not found
------Build DEBIAN------
/__w/16/DEBIAN/scripts/build.includes: line 78: dpkg-architecture: command not found
../../../scripts/build_template.includes: line 118: svnversion: command not found
Setting up tzdata (2024a-0ubuntu0.20.04) ...
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
Configuring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc
2. America 5. Arctic 8. Europe 11. SystemV
3. Antarctica 6. Asia 9. Indian 12. US
Geographic area:
##[error]The operation was canceled.
所以我有这三个 gameObjects 围绕着旋转的 player 和一个用于幽灵的库存系统,它们最终会治愈玩家。我按照这个教程:\'https://www.youtube.com/watch?v=AoD_F1fSFFg\' 并且当你拾取一个物品时,它会显示在你的库存中。我希望精灵不显示在库存中,而是出现在 gameObjects 围绕的 player ,但我不确定如何做到这一点。请帮忙。
public class GhostManager : MonoBehaviour
{
public static GhostManager Instance;
public List<Ghost> Ghosts = new List<Ghost>();
public GameObject ghost1;
public GameObject ghost2;
public GameObject ghost3;
private void Awake()
{
Instance = this;
}
public void Add(Ghost ghost)
{
Ghosts.Add(ghost);
}
public void Remove(Ghost ghost)
{
Ghosts.Remove(ghost);
}
public void ListItems()
{
foreach (var ghost in Ghosts)
{
GameObject obj = Instantiate(ghost1);
var ghostIcon = obj.transform.Find("GhostIcon").GetComponent<Image>();
ghostIcon.sprite = ghost.icon;
}
}
}
public class GhostPickUp : MonoBehaviour
{
public Ghost ghost;
private int maxGhosts = 3;
void PickUp()
{
if (GhostManager.Instance.Ghosts.Count < maxGhosts)
{
GhostManager.Instance.Add(ghost);
Destroy(gameObject);
}
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
PickUp();
}
}
}
[CreateAssetMenu(fileName = "New Ghost", menuName = "Ghosts/Create New Ghosts")]
public class Ghost : ScriptableObject
{
public int id;
public string itemName;
public int value;
public Sprite icon;
}
for (var i = 0; i < 3; i++){ // Or you can just use List<GameObject> ghostVisuals instead of ghost1, ghost2 and ghost3 GameObject currentGhost = null; if (i == 0) currentGhost = ghost1; else if (i == 1) currentGhost = ghost2; else if (i == 2) currentGhost = ghost3; else throw new InvalidOperationException(); if (Ghosts.Count > i) { currentGhost.SetActive(true); // We have a ghost, so enable the GameObject // Here you access the data you need for the `currentGhost` // e.g. if you have added a child GhostIcon to it: var ghostIcon = currentGhost.transform.Find("GhostIcon").GetComponent<Image>(); ghostIcon.sprite = Ghosts[i].icon; } else { currentGhost.SetActive(false); // No more ghosts, disable the game object }}
sdlada_2.5.20_cd53c280$ alr run
Running pre-build actions for sdlada=2.5.20...
make : on entre dans le répertoire « /media/dubois/4To/Donnees/Courrier/020-Ada/X-Bibliotheque/sdlada_2.5.20_cd53c280/build/gnat »
mkdir -p gen/src/
make : on quitte le répertoire « /media/dubois/4To/Donnees/Courrier/020-Ada/X-Bibliotheque/sdlada_2.5.20_cd53c280/build/gnat »
Building sdlada=2.5.20/build/gnat/sdlada.gpr...
Build finished successfully in 0.47 seconds.
error: Executable "sdlada" not found
dubois@db:/media/dubois/4To/Donnees/Courrier/020-Ada/X-Bibliotheque/sdlada_2.5.20_cd53c280
$
-第二个问题是“with sdlada”失败:
$ ./gnatmake -P unit_tests.gpr
--------------------------------
Compilation du unit_tests
--------------------------------
Compile
[Ada] unit_tests.adb
unit_tests.adb:28:06: error: file "aunit.ads" not found
unit_tests.adb:29:06: error: file "aunit.ads" not found
unit_tests.adb:30:06: error: file "aunit.ads" not found
unit_tests.adb:30:06: error: "Unit_Tests (body)" depends on "Sdl_Suites (spec)"
unit_tests.adb:30:06: error: "Sdl_Suites (spec)" depends on "Aunit (spec)"
gprbuild: *** compilation phase failed
$
with unit_tests.adb as:
with AUnit.Run;
with AUnit.Reporter.Text;
with SDL_Suites;
procedure Unit_Tests is
etc..