mirror of
				https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
				synced 2024-08-15 00:43:27 +00:00 
			
		
		
		
	Stage cards and basic stage management
This commit is contained in:
		
							parent
							
								
									1dd7781179
								
							
						
					
					
						commit
						f0d46df3d6
					
				
					 200 changed files with 2829 additions and 81 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -96,10 +96,13 @@
 | 
			
		|||
    <Compile Include="Assets\Scripts\GUI\ActorKeyframeCard.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\GUI\AnimationTimeline.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\GUI\KeyframeSlider.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\GUI\StageCard.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\GenMath.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\ObjectExtensions.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\PawnUtility.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\SimpleCurve.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\Singleton.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\StageCardManager.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\StandaloneFileBrowser\IStandaloneFileBrowser.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\StandaloneFileBrowser\Sample\BasicSample.cs" />
 | 
			
		||||
    <Compile Include="Assets\Scripts\StandaloneFileBrowser\Sample\CanvasSampleOpenFileImage.cs" />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1061
									
								
								Assets/Resources/Prefabs/StageCard.prefab
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1061
									
								
								Assets/Resources/Prefabs/StageCard.prefab
									
										
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										7
									
								
								Assets/Resources/Prefabs/StageCard.prefab.meta
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/Resources/Prefabs/StageCard.prefab.meta
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
fileFormatVersion: 2
 | 
			
		||||
guid: 378b361fe27c31b458e2a82a0e6083b3
 | 
			
		||||
PrefabImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								Assets/Resources/Textures/UI/plain-arrow (2).png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Assets/Resources/Textures/UI/plain-arrow (2).png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 4 KiB  | 
							
								
								
									
										92
									
								
								Assets/Resources/Textures/UI/plain-arrow (2).png.meta
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								Assets/Resources/Textures/UI/plain-arrow (2).png.meta
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,92 @@
 | 
			
		|||
fileFormatVersion: 2
 | 
			
		||||
guid: 0a1b88d229cbb924291c624071b31d50
 | 
			
		||||
TextureImporter:
 | 
			
		||||
  internalIDToNameTable: []
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  serializedVersion: 11
 | 
			
		||||
  mipmaps:
 | 
			
		||||
    mipMapMode: 0
 | 
			
		||||
    enableMipMap: 0
 | 
			
		||||
    sRGBTexture: 1
 | 
			
		||||
    linearTexture: 0
 | 
			
		||||
    fadeOut: 0
 | 
			
		||||
    borderMipMap: 0
 | 
			
		||||
    mipMapsPreserveCoverage: 0
 | 
			
		||||
    alphaTestReferenceValue: 0.5
 | 
			
		||||
    mipMapFadeDistanceStart: 1
 | 
			
		||||
    mipMapFadeDistanceEnd: 3
 | 
			
		||||
  bumpmap:
 | 
			
		||||
    convertToNormalMap: 0
 | 
			
		||||
    externalNormalMap: 0
 | 
			
		||||
    heightScale: 0.25
 | 
			
		||||
    normalMapFilter: 0
 | 
			
		||||
  isReadable: 0
 | 
			
		||||
  streamingMipmaps: 0
 | 
			
		||||
  streamingMipmapsPriority: 0
 | 
			
		||||
  grayScaleToAlpha: 0
 | 
			
		||||
  generateCubemap: 6
 | 
			
		||||
  cubemapConvolution: 0
 | 
			
		||||
  seamlessCubemap: 0
 | 
			
		||||
  textureFormat: 1
 | 
			
		||||
  maxTextureSize: 2048
 | 
			
		||||
  textureSettings:
 | 
			
		||||
    serializedVersion: 2
 | 
			
		||||
    filterMode: -1
 | 
			
		||||
    aniso: -1
 | 
			
		||||
    mipBias: -100
 | 
			
		||||
    wrapU: 1
 | 
			
		||||
    wrapV: 1
 | 
			
		||||
    wrapW: 1
 | 
			
		||||
  nPOTScale: 0
 | 
			
		||||
  lightmap: 0
 | 
			
		||||
  compressionQuality: 50
 | 
			
		||||
  spriteMode: 1
 | 
			
		||||
  spriteExtrude: 1
 | 
			
		||||
  spriteMeshType: 1
 | 
			
		||||
  alignment: 0
 | 
			
		||||
  spritePivot: {x: 0.5, y: 0.5}
 | 
			
		||||
  spritePixelsToUnits: 100
 | 
			
		||||
  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
 | 
			
		||||
  spriteGenerateFallbackPhysicsShape: 1
 | 
			
		||||
  alphaUsage: 1
 | 
			
		||||
  alphaIsTransparency: 1
 | 
			
		||||
  spriteTessellationDetail: -1
 | 
			
		||||
  textureType: 8
 | 
			
		||||
  textureShape: 1
 | 
			
		||||
  singleChannelComponent: 0
 | 
			
		||||
  maxTextureSizeSet: 0
 | 
			
		||||
  compressionQualitySet: 0
 | 
			
		||||
  textureFormatSet: 0
 | 
			
		||||
  applyGammaDecoding: 0
 | 
			
		||||
  platformSettings:
 | 
			
		||||
  - serializedVersion: 3
 | 
			
		||||
    buildTarget: DefaultTexturePlatform
 | 
			
		||||
    maxTextureSize: 2048
 | 
			
		||||
    resizeAlgorithm: 0
 | 
			
		||||
    textureFormat: -1
 | 
			
		||||
    textureCompression: 1
 | 
			
		||||
    compressionQuality: 50
 | 
			
		||||
    crunchedCompression: 0
 | 
			
		||||
    allowsAlphaSplitting: 0
 | 
			
		||||
    overridden: 0
 | 
			
		||||
    androidETC2FallbackOverride: 0
 | 
			
		||||
    forceMaximumCompressionQuality_BC6H_BC7: 0
 | 
			
		||||
  spriteSheet:
 | 
			
		||||
    serializedVersion: 2
 | 
			
		||||
    sprites: []
 | 
			
		||||
    outline: []
 | 
			
		||||
    physicsShape: []
 | 
			
		||||
    bones: []
 | 
			
		||||
    spriteID: 5e97eb03825dee720800000000000000
 | 
			
		||||
    internalID: 0
 | 
			
		||||
    vertices: []
 | 
			
		||||
    indices: 
 | 
			
		||||
    edges: []
 | 
			
		||||
    weights: []
 | 
			
		||||
    secondaryTextures: []
 | 
			
		||||
  spritePackingTag: 
 | 
			
		||||
  pSDRemoveMatte: 0
 | 
			
		||||
  pSDShowRemoveMatteOption: 0
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
				
			
			@ -181,6 +181,8 @@ namespace RimWorldAnimationStudio
 | 
			
		|||
                animationTimeline.Initialize(actorID);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            StageCardManager.Instance.Initialize();
 | 
			
		||||
 | 
			
		||||
            Workspace.isDirty = false;
 | 
			
		||||
 | 
			
		||||
            UpdateAnimation();
 | 
			
		||||
| 
						 | 
				
			
			@ -204,6 +206,72 @@ namespace RimWorldAnimationStudio
 | 
			
		|||
            actorBodies.Clear();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool AddAnimationStage()
 | 
			
		||||
        {
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool CloneAnimationStage()
 | 
			
		||||
        {
 | 
			
		||||
            AnimationStage stage = Workspace.animationDef.animationStages[Workspace.stageID].Copy();
 | 
			
		||||
            stage.Initialize();
 | 
			
		||||
            stage.stageName += " (Clone)";
 | 
			
		||||
 | 
			
		||||
            Workspace.animationDef.animationStages.Insert(Workspace.stageID + 1, stage);
 | 
			
		||||
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool MoveAnimationStage(int startIndex, int delta)
 | 
			
		||||
        {
 | 
			
		||||
            if (startIndex + delta < 0 || startIndex + delta >= Workspace.animationDef.animationStages.Count)
 | 
			
		||||
            { return false; }
 | 
			
		||||
 | 
			
		||||
            AnimationStage stage = Workspace.animationDef.animationStages[startIndex];
 | 
			
		||||
            Workspace.animationDef.animationStages[startIndex] = Workspace.animationDef.animationStages[startIndex + delta];
 | 
			
		||||
            Workspace.animationDef.animationStages[startIndex + delta] = stage;
 | 
			
		||||
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool RemoveAnimationStage()
 | 
			
		||||
        {
 | 
			
		||||
            if (Workspace.animationDef.animationStages.Count == 1)
 | 
			
		||||
            { 
 | 
			
		||||
                Debug.LogWarning("Cannot delete animation stage - the animation must contain at least one animation stage.");
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            Workspace.animationDef.animationStages.RemoveAt(Workspace.stageID);
 | 
			
		||||
            Workspace.stageID = Workspace.stageID >= Workspace.animationDef.animationStages.Count ? Workspace.stageID = Workspace.animationDef.animationStages.Count - 1 : Workspace.stageID;
 | 
			
		||||
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool AddActor()
 | 
			
		||||
        {
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool RemoveActor()
 | 
			
		||||
        {
 | 
			
		||||
            if (Workspace.animationDef.actors.Count == 1)
 | 
			
		||||
            {
 | 
			
		||||
                Debug.LogWarning("Cannot delete actor - the animation must contain at least one actor.");
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            foreach (AnimationStage stage in Workspace.animationDef.animationStages)
 | 
			
		||||
            { stage.animationClips.RemoveAt(Workspace.actorID); }
 | 
			
		||||
 | 
			
		||||
            Workspace.animationDef.actors.RemoveAt(Workspace.actorID);
 | 
			
		||||
            Workspace.actorID = Workspace.actorID >= Workspace.animationDef.actors.Count ? Workspace.actorID = Workspace.animationDef.actors.Count - 1 : Workspace.actorID;
 | 
			
		||||
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        public void ToggleAnimation()
 | 
			
		||||
        {
 | 
			
		||||
            isAnimating = !isAnimating;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										61
									
								
								Assets/Scripts/GUI/StageCard.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								Assets/Scripts/GUI/StageCard.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,61 @@
 | 
			
		|||
using System.Collections;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using UnityEngine;
 | 
			
		||||
using UnityEngine.UI;
 | 
			
		||||
 | 
			
		||||
namespace RimWorldAnimationStudio
 | 
			
		||||
{
 | 
			
		||||
    public class StageCard : MonoBehaviour
 | 
			
		||||
    {
 | 
			
		||||
        private Image banner;
 | 
			
		||||
        private Toggle toggle;
 | 
			
		||||
 | 
			
		||||
        public void OnNameChange()
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void OnSelectStage()
 | 
			
		||||
        {
 | 
			
		||||
            if (GetComponent<Toggle>().isOn && Workspace.stageID != transform.GetSiblingIndex())
 | 
			
		||||
            { Workspace.stageID = transform.GetSiblingIndex(); }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void OnMoveStage(int delta)
 | 
			
		||||
        {
 | 
			
		||||
            if (AnimationController.Instance.MoveAnimationStage(transform.GetSiblingIndex(), delta))
 | 
			
		||||
            {
 | 
			
		||||
                int siblingCount = transform.parent.childCount;
 | 
			
		||||
                int index = Mathf.Clamp(transform.GetSiblingIndex() + delta, 0, siblingCount - 1);
 | 
			
		||||
 | 
			
		||||
                transform.SetSiblingIndex(index);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void Start()
 | 
			
		||||
        {
 | 
			
		||||
            banner = transform.Find("Banner").GetComponent<Image>();
 | 
			
		||||
            toggle = GetComponent<Toggle>();
 | 
			
		||||
            toggle.group = StageCardManager.Instance.GetComponent<ToggleGroup>();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void Update()
 | 
			
		||||
        {
 | 
			
		||||
            if (Workspace.stageID == transform.GetSiblingIndex())
 | 
			
		||||
            { 
 | 
			
		||||
                banner.gameObject.SetActive(true);
 | 
			
		||||
 | 
			
		||||
                if (toggle.isOn == false)
 | 
			
		||||
                { toggle.isOn = true; }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            else
 | 
			
		||||
            { 
 | 
			
		||||
                banner.gameObject.SetActive(false);
 | 
			
		||||
 | 
			
		||||
                if (toggle.isOn)
 | 
			
		||||
                { toggle.isOn = false; }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								Assets/Scripts/GUI/StageCard.cs.meta
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Scripts/GUI/StageCard.cs.meta
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
fileFormatVersion: 2
 | 
			
		||||
guid: 20b2be62d5fdc4b4992cede005ec2aee
 | 
			
		||||
MonoImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  serializedVersion: 2
 | 
			
		||||
  defaultReferences: []
 | 
			
		||||
  executionOrder: 0
 | 
			
		||||
  icon: {instanceID: 0}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
							
								
								
									
										131
									
								
								Assets/Scripts/ObjectExtensions.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										131
									
								
								Assets/Scripts/ObjectExtensions.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,131 @@
 | 
			
		|||
using System.Collections.Generic;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using System.ArrayExtensions;
 | 
			
		||||
 | 
			
		||||
namespace System
 | 
			
		||||
{
 | 
			
		||||
    public static class ObjectExtensions
 | 
			
		||||
    {
 | 
			
		||||
        private static readonly MethodInfo CloneMethod = typeof(Object).GetMethod("MemberwiseClone", BindingFlags.NonPublic | BindingFlags.Instance);
 | 
			
		||||
 | 
			
		||||
        public static bool IsPrimitive(this Type type)
 | 
			
		||||
        {
 | 
			
		||||
            if (type == typeof(String)) return true;
 | 
			
		||||
            return (type.IsValueType & type.IsPrimitive);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public static Object Copy(this Object originalObject)
 | 
			
		||||
        {
 | 
			
		||||
            return InternalCopy(originalObject, new Dictionary<Object, Object>(new ReferenceEqualityComparer()));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private static Object InternalCopy(Object originalObject, IDictionary<Object, Object> visited)
 | 
			
		||||
        {
 | 
			
		||||
            if (originalObject == null) return null;
 | 
			
		||||
            var typeToReflect = originalObject.GetType();
 | 
			
		||||
            if (IsPrimitive(typeToReflect)) return originalObject;
 | 
			
		||||
            if (visited.ContainsKey(originalObject)) return visited[originalObject];
 | 
			
		||||
            if (typeof(Delegate).IsAssignableFrom(typeToReflect)) return null;
 | 
			
		||||
            var cloneObject = CloneMethod.Invoke(originalObject, null);
 | 
			
		||||
            if (typeToReflect.IsArray)
 | 
			
		||||
            {
 | 
			
		||||
                var arrayType = typeToReflect.GetElementType();
 | 
			
		||||
                if (IsPrimitive(arrayType) == false)
 | 
			
		||||
                {
 | 
			
		||||
                    Array clonedArray = (Array)cloneObject;
 | 
			
		||||
                    clonedArray.ForEach((array, indices) => array.SetValue(InternalCopy(clonedArray.GetValue(indices), visited), indices));
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            visited.Add(originalObject, cloneObject);
 | 
			
		||||
            CopyFields(originalObject, visited, cloneObject, typeToReflect);
 | 
			
		||||
            RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect);
 | 
			
		||||
            return cloneObject;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private static void RecursiveCopyBaseTypePrivateFields(object originalObject, IDictionary<object, object> visited, object cloneObject, Type typeToReflect)
 | 
			
		||||
        {
 | 
			
		||||
            if (typeToReflect.BaseType != null)
 | 
			
		||||
            {
 | 
			
		||||
                RecursiveCopyBaseTypePrivateFields(originalObject, visited, cloneObject, typeToReflect.BaseType);
 | 
			
		||||
                CopyFields(originalObject, visited, cloneObject, typeToReflect.BaseType, BindingFlags.Instance | BindingFlags.NonPublic, info => info.IsPrivate);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private static void CopyFields(object originalObject, IDictionary<object, object> visited, object cloneObject, Type typeToReflect, BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.FlattenHierarchy, Func<FieldInfo, bool> filter = null)
 | 
			
		||||
        {
 | 
			
		||||
            foreach (FieldInfo fieldInfo in typeToReflect.GetFields(bindingFlags))
 | 
			
		||||
            {
 | 
			
		||||
                if (filter != null && filter(fieldInfo) == false) continue;
 | 
			
		||||
                if (IsPrimitive(fieldInfo.FieldType)) continue;
 | 
			
		||||
                var originalFieldValue = fieldInfo.GetValue(originalObject);
 | 
			
		||||
                var clonedFieldValue = InternalCopy(originalFieldValue, visited);
 | 
			
		||||
                fieldInfo.SetValue(cloneObject, clonedFieldValue);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        public static T Copy<T>(this T original)
 | 
			
		||||
        {
 | 
			
		||||
            return (T)Copy((Object)original);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class ReferenceEqualityComparer : EqualityComparer<Object>
 | 
			
		||||
    {
 | 
			
		||||
        public override bool Equals(object x, object y)
 | 
			
		||||
        {
 | 
			
		||||
            return ReferenceEquals(x, y);
 | 
			
		||||
        }
 | 
			
		||||
        public override int GetHashCode(object obj)
 | 
			
		||||
        {
 | 
			
		||||
            if (obj == null) return 0;
 | 
			
		||||
            return obj.GetHashCode();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    namespace ArrayExtensions
 | 
			
		||||
    {
 | 
			
		||||
        public static class ArrayExtensions
 | 
			
		||||
        {
 | 
			
		||||
            public static void ForEach(this Array array, Action<Array, int[]> action)
 | 
			
		||||
            {
 | 
			
		||||
                if (array.LongLength == 0) return;
 | 
			
		||||
                ArrayTraverse walker = new ArrayTraverse(array);
 | 
			
		||||
                do action(array, walker.Position);
 | 
			
		||||
                while (walker.Step());
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        internal class ArrayTraverse
 | 
			
		||||
        {
 | 
			
		||||
            public int[] Position;
 | 
			
		||||
            private int[] maxLengths;
 | 
			
		||||
 | 
			
		||||
            public ArrayTraverse(Array array)
 | 
			
		||||
            {
 | 
			
		||||
                maxLengths = new int[array.Rank];
 | 
			
		||||
                for (int i = 0; i < array.Rank; ++i)
 | 
			
		||||
                {
 | 
			
		||||
                    maxLengths[i] = array.GetLength(i) - 1;
 | 
			
		||||
                }
 | 
			
		||||
                Position = new int[array.Rank];
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            public bool Step()
 | 
			
		||||
            {
 | 
			
		||||
                for (int i = 0; i < Position.Length; ++i)
 | 
			
		||||
                {
 | 
			
		||||
                    if (Position[i] < maxLengths[i])
 | 
			
		||||
                    {
 | 
			
		||||
                        Position[i]++;
 | 
			
		||||
                        for (int j = 0; j < i; j++)
 | 
			
		||||
                        {
 | 
			
		||||
                            Position[j] = 0;
 | 
			
		||||
                        }
 | 
			
		||||
                        return true;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								Assets/Scripts/ObjectExtensions.cs.meta
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Scripts/ObjectExtensions.cs.meta
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
fileFormatVersion: 2
 | 
			
		||||
guid: f7f234a811195334b8390740155d41dd
 | 
			
		||||
MonoImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  serializedVersion: 2
 | 
			
		||||
  defaultReferences: []
 | 
			
		||||
  executionOrder: 0
 | 
			
		||||
  icon: {instanceID: 0}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
							
								
								
									
										50
									
								
								Assets/Scripts/StageCardManager.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								Assets/Scripts/StageCardManager.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,50 @@
 | 
			
		|||
using System.Collections;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using UnityEngine;
 | 
			
		||||
using UnityEngine.UI;
 | 
			
		||||
 | 
			
		||||
namespace RimWorldAnimationStudio
 | 
			
		||||
{
 | 
			
		||||
    public class StageCardManager : Singleton<StageCardManager>
 | 
			
		||||
    {
 | 
			
		||||
        public StageCard stageCardPrefab;
 | 
			
		||||
 | 
			
		||||
        public void Initialize()
 | 
			
		||||
        {
 | 
			
		||||
            foreach(AnimationStage stage in Workspace.animationDef.animationStages)
 | 
			
		||||
            {
 | 
			
		||||
                MakeStageCard(stage.stageName);    
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public StageCard MakeStageCard(string stageName = null)
 | 
			
		||||
        {
 | 
			
		||||
            StageCard stageCard = Instantiate(stageCardPrefab, transform);
 | 
			
		||||
 | 
			
		||||
            if (stageName != null)
 | 
			
		||||
            { stageCard.transform.Find("StageNameField").GetComponent<InputField>().text = stageName; }
 | 
			
		||||
 | 
			
		||||
            return stageCard;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void OnNewStage()
 | 
			
		||||
        {
 | 
			
		||||
            MakeStageCard();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void OnCloneStage()
 | 
			
		||||
        {
 | 
			
		||||
            if (AnimationController.Instance.CloneAnimationStage())
 | 
			
		||||
            {
 | 
			
		||||
                StageCard stageCard = MakeStageCard(Workspace.animationDef.animationStages[Workspace.stageID + 1].stageName);
 | 
			
		||||
                stageCard.transform.SetSiblingIndex(Workspace.stageID + 1);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void OnDeleteStage()
 | 
			
		||||
        {
 | 
			
		||||
            if (AnimationController.Instance.RemoveAnimationStage())
 | 
			
		||||
            { Destroy(transform.GetChild(Workspace.stageID).gameObject); }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								Assets/Scripts/StageCardManager.cs.meta
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/Scripts/StageCardManager.cs.meta
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
fileFormatVersion: 2
 | 
			
		||||
guid: 7ecd16bf04b637f4c96d6ae733205d3a
 | 
			
		||||
MonoImporter:
 | 
			
		||||
  externalObjects: {}
 | 
			
		||||
  serializedVersion: 2
 | 
			
		||||
  defaultReferences: []
 | 
			
		||||
  executionOrder: 0
 | 
			
		||||
  icon: {instanceID: 0}
 | 
			
		||||
  userData: 
 | 
			
		||||
  assetBundleName: 
 | 
			
		||||
  assetBundleVariant: 
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/01/01b1fab59345a232a3f65b93e9f790d8
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/01/01b1fab59345a232a3f65b93e9f790d8
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/07/078d52db589cb888590a8ec29cb39f17
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/07/078d52db589cb888590a8ec29cb39f17
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/0b/0bc242aef91795e0a5ed17c8dfc1d1bf
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/0b/0bc242aef91795e0a5ed17c8dfc1d1bf
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/14/1469e2e88f0fc3a3a991a610d1db68ae
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/14/1469e2e88f0fc3a3a991a610d1db68ae
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/1b/1b09d027c9fbb2600aedddeed842513e
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/1b/1b09d027c9fbb2600aedddeed842513e
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/20/20c55a7d77cfa157d131bb74e221b9e0
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/20/20c55a7d77cfa157d131bb74e221b9e0
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/22/229519e9937ee91b85ebdc646d2e455d
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/22/229519e9937ee91b85ebdc646d2e455d
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/30/3053d7de037ee9b6b683d2b324bd0ee3
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/30/3053d7de037ee9b6b683d2b324bd0ee3
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/30/307d45da6b9461f1a35fae082b6c8c50
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/30/307d45da6b9461f1a35fae082b6c8c50
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/31/313f76eb46a088f5db0da783a35817d0
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/31/313f76eb46a088f5db0da783a35817d0
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/37/37dff6815eecbdc7b32fb8553247b078
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/37/37dff6815eecbdc7b32fb8553247b078
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/3a/3a1cc2f95f3725edd12898cc58312e0f
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/3a/3a1cc2f95f3725edd12898cc58312e0f
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/3a/3a5987a175c7b5fd0acf9f5ff14491c7
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/3a/3a5987a175c7b5fd0acf9f5ff14491c7
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 8.4 KiB  | 
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/41/41b8881c0dc65164345eb943573b27df
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/41/41b8881c0dc65164345eb943573b27df
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/44/444596e4671ad83721a4c51dcf760f3a
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/44/444596e4671ad83721a4c51dcf760f3a
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/44/447a402a7c10f416c797a607d7b4ec8b
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/44/447a402a7c10f416c797a607d7b4ec8b
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/46/46c8f31b8d0471865492662944df7ec4
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/46/46c8f31b8d0471865492662944df7ec4
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/4d/4d5a36fbb035ad57a612220423373604
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/4d/4d5a36fbb035ad57a612220423373604
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/51/51b71a12593e752e57d3d07017e99959
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/51/51b71a12593e752e57d3d07017e99959
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/56/5669bebccf552c64f49418989f8f31a1
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/56/5669bebccf552c64f49418989f8f31a1
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/68/68a9174d3ce459b0e47775f5678ee8ae
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/68/68a9174d3ce459b0e47775f5678ee8ae
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/76/761b954132287ca2e156bec9c2440cd4
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/76/761b954132287ca2e156bec9c2440cd4
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 2.8 KiB  | 
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/79/799783e5f60996f2d2f8e7f139224400
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/79/799783e5f60996f2d2f8e7f139224400
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/7b/7b54b38cb3c059e83e56e14cb1902006
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/7b/7b54b38cb3c059e83e56e14cb1902006
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Library/Artifacts/7b/7b64aaf45d38e61e88ffae0f535a8152
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Library/Artifacts/7b/7b64aaf45d38e61e88ffae0f535a8152
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							Some files were not shown because too many files have changed in this diff Show more
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue