我正在嘗試使用 AddNotesToDiary 函式將當前索引注釋實體化/移動/添加到日記陣列。移動到日記陣列時,應將索引筆記從筆記陣列中洗掉。我有這個想法,雖然我無法弄清楚前進的方向。
//list of Notes
public string[] notes;
public int index; //which current note available
public string currentNote;
//Collected Notes or Diary
public string[] Diary;
private void Start()
{
//current note in the index
currentNote = notes[index];
}
private void Update()
{
//current note in the index
currentNote = notes[index];
}
private void AddNotesToDiary()
{
//how to instantiate/move/add the note[index] to the Diary[]
}
uj5u.com熱心網友回復:
你可以string[]
用List<string>
. 這將允許您在筆記和日記中添加和洗掉:
notes.Remove(currentNote);
Diary.Add(currentNote);
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/483519.html