HeavenStudioPlus/Assets/Scripts/StudioDance/StudioDanceManager.cs
minenice55 d7ab27439c Resource Optimization (#812)
* right foot creep

* look around stay low

* optimize the fan club prefab

use anim layers for the monkeys

* dansa med oss

* klappa era hander

* cossack sandvich

* soldier of dance

add speed halving / doubling functionality to choreographies

* fix selection of starting dance

* asset re-organization

* organize the last of the 1.0 games

* Wall

* floating windows can no longer become larger than the actual screen
2024-03-29 23:00:59 -04:00

49 lines
No EOL
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio;
using TMPro;
namespace HeavenStudio.StudioDance
{
public class StudioDanceManager : MonoBehaviour
{
[SerializeField] private GameObject windowBase;
[SerializeField] private Transform windowHolder;
[SerializeField] private GameObject content;
[SerializeField] private Dancer dancer;
[SerializeField] private TMP_Dropdown dropdown;
public void OpenDanceWindow()
{
windowBase.SetActive(true);
content.SetActive(true);
dancer.SetStartChoreography();
dropdown.ClearOptions();
int i = 0;
foreach (ChoreographyInfo choreography in dancer.ChoreographyInfos)
{
dropdown.options.Add(new TMP_Dropdown.OptionData(choreography.choreographyName));
if (choreography == dancer.CurrentChoreography)
{
dropdown.value = i;
}
i++;
}
dropdown.RefreshShownValue();
}
public void CloseDanceWindow()
{
windowBase.SetActive(false);
content.SetActive(false);
Editor.CreditsLegalSettings.MakeSecretInactive();
}
public void OnDropdownValueChanged(int index)
{
dancer.SetChoreography(index);
}
}
}