private void Start() { inactiveSkinBoxes = new List <SkinBox>(skinBoxes); _currentSkinBox = null; SetupSkinBoxes(); }
void SetCurrentSkinBox(SkinBox skinBox) { if (_currentSkinBox != null) { _currentSkinBox.Deselect(); } _currentSkinBox = skinBox; _currentSkinBox.Select(); }
public void ChooseSkinbox() { _elapsedTime += Time.deltaTime; var isFinal = _traveledCount == TravelCount || inactiveSkinBoxes.Count == 0; var inTime = _elapsedTime >= _traveledCount / 10f; if (!isFinal && inTime) { // Reset time _elapsedTime = 0f; ++_traveledCount; SelectSkinBox(); } else if (isFinal && inTime) { _elapsedTime = 0f; _currentSkinBox.Activate(); _currentSkinBox = null; _traveledCount = 0; _travel = false; } }