I am making a note wheel to help teach music. I change the letters by referencing an array, but this has caused the sharps and flats to not follow the letters. To fix this I am trying to take the sharps and flats from the other letters on the wheel, but I am getting this error:
Assets\Rotate.cs(65,35): error CS1061: ‘GameObject’ does not contain a definition for ‘tune’ and no accessible extension method ‘tune’ accepting a first argument of type ‘GameObject’ could be found (are you missing a using directive or an assembly reference?)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class Rotate : MonoBehaviour
{
public string display;
public static int turn;
public int letter;
public int tune;
string[] noteArray = { "D", "E", "F", "G", "A", "B", "C", "D♯", "E♯", "F♯", "G♯",
"A♯", "B♯", "C♯", "D♭", "E♭", "F♭", "G♭", "A♭", "B♭", "C♭" };
public TextMeshProUGUI note;
public float current = 0;
public GameObject[] AllNotes;
public int identify;
int identification;
public int nextTune;
void Start()
{
display = noteArray[letter + (7 * tune)];
note.text = display;
}
void Update()
{
tune = nextTune;
if (current == 1)
{
turn = 0;
current = 0;
}
if (turn != 0)
{
current = current + 1;
letter = letter - turn;
if (letter == 7)
{
letter = 0;
}
if (letter == -1)
{
letter = 6;
}
identification = identify - turn;
if (identification == 7)
{
identification= 0;
}
if (identification == -1)
{
identification = 6;
}
var noteBefore = AllNotes[identification];
nextTune = noteBefore.tune;
}
}
public void Retune()
{
tune = tune + 1;
if (tune == 3)
{
tune = 0;
}
display = noteArray[letter + (7 * tune)];
note.text = display;
}
}