mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Code refactor
This commit is contained in:
parent
757badf4f6
commit
a55ba7b95b
232 changed files with 1282 additions and 936 deletions
28
Assets/Scripts/GUI/Props/SexPropManager.cs
Normal file
28
Assets/Scripts/GUI/Props/SexPropManager.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
public class SexPropManager : MonoBehaviour
|
||||
{
|
||||
public List<SexProp> sexProps = new List<SexProp>();
|
||||
public Dropdown sexPropDropdown;
|
||||
|
||||
private SpriteRenderer spriteRenderer;
|
||||
|
||||
public void OnEnable()
|
||||
{
|
||||
spriteRenderer = GetComponent<SpriteRenderer>();
|
||||
|
||||
foreach (SexProp sexProp in sexProps)
|
||||
{ sexPropDropdown.options.Add(new Dropdown.OptionData(sexProp.label)); }
|
||||
}
|
||||
|
||||
public void OnOptionChanged()
|
||||
{
|
||||
spriteRenderer.sprite = sexProps[sexPropDropdown.value].sprite;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue