Code refactor

This commit is contained in:
AbstractConcept 2022-10-28 00:28:51 -05:00
parent 757badf4f6
commit a55ba7b95b
232 changed files with 1282 additions and 936 deletions

View file

@ -0,0 +1,12 @@
using System;
using UnityEngine;
namespace RimWorldAnimationStudio
{
[Serializable]
public class SexProp
{
public string label;
public Sprite sprite;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 94f6b7ad49adabe428c011abfcf4da53
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 587f7397b0c3ecf4495edb8af5dbd777
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: