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
12
Assets/Scripts/GUI/Props/SexProp.cs
Normal file
12
Assets/Scripts/GUI/Props/SexProp.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
[Serializable]
|
||||
public class SexProp
|
||||
{
|
||||
public string label;
|
||||
public Sprite sprite;
|
||||
}
|
||||
}
|
11
Assets/Scripts/GUI/Props/SexProp.cs.meta
Normal file
11
Assets/Scripts/GUI/Props/SexProp.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 94f6b7ad49adabe428c011abfcf4da53
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
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;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/GUI/Props/SexPropManager.cs.meta
Normal file
11
Assets/Scripts/GUI/Props/SexPropManager.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 587f7397b0c3ecf4495edb8af5dbd777
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue