HeavenStudioPlus/Assets/Scripts/StudioDance/StudioDanceManager.cs
minenice55 7ccc256eaf 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-30 02:52:14 +00: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);
}
}
}