Skip to content

Commit

Permalink
populate puzzle from scriptable object
Browse files Browse the repository at this point in the history
  • Loading branch information
ameliajmoser committed Sep 16, 2024
1 parent 109ea82 commit 674e2d7
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Assets/Project/Data/Puzzles/Leo.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c58baf77432a10244acefb3ca320caa1, type: 3}
m_Name: Leo
m_EditorClassIdentifier:
m_PuzzleObjects:
m_PuzzleRefs:
- RefObject: {fileID: 11400000, guid: eafaa97d14e43aa4ab8aa2c9732d0693, type: 2}
ShowProperties: 34
ShowProperties: 10
- RefObject: {fileID: 11400000, guid: fdd8d7541758faa448f475232b13d819, type: 2}
ShowProperties: 34
ShowProperties: 2
- RefObject: {fileID: 11400000, guid: ad82f7c67c40e7b478d7e73eabac0c05, type: 2}
ShowProperties: 42
ShowProperties: 10
- RefObject: {fileID: 11400000, guid: 10d9d00870e69dc49a7bc5b90497791f, type: 2}
ShowProperties: 6
m_Clues:
Expand Down
24 changes: 14 additions & 10 deletions Assets/Project/Prefabs/Postcards/PostcardPuzzleHorizontal.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Button
m_text: Finish
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
Expand All @@ -616,8 +616,8 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
Expand All @@ -640,7 +640,7 @@ MonoBehaviour:
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
Expand Down Expand Up @@ -1099,7 +1099,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &8746709303137106571
RectTransform:
m_ObjectHideFlags: 0
Expand All @@ -1118,8 +1118,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -4, y: 4}
m_SizeDelta: {x: 160, y: 50}
m_AnchoredPosition: {x: -15, y: 15}
m_SizeDelta: {x: 210, y: 70}
m_Pivot: {x: 1, y: 0}
--- !u!222 &2998185016765499790
CanvasRenderer:
Expand Down Expand Up @@ -1150,7 +1150,7 @@ MonoBehaviour:
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_NormalColor: {r: 0.24875402, g: 0.45780137, b: 0.8113208, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
Expand All @@ -1169,7 +1169,7 @@ MonoBehaviour:
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 0}
m_TargetGraphic: {fileID: 5295124876076571565}
m_OnClick:
m_PersistentCalls:
m_Calls: []
Expand All @@ -1186,7 +1186,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.4009434, g: 0.6140097, b: 1, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
Expand Down Expand Up @@ -2535,6 +2535,10 @@ MonoBehaviour:
- {fileID: 6651233270880856590}
- {fileID: 1382012353175599924}
- {fileID: 4669792757732369514}
Clues:
- {fileID: 7239627528006946004}
- {fileID: 8732284153573659785}
- {fileID: 7283120328074507190}
m_FinishButton: {fileID: 8804041329015251587}
--- !u!224 &3471607100287258981 stripped
RectTransform:
Expand Down
171 changes: 170 additions & 1 deletion Assets/Project/Scenes/Skybox.unity
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,42 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: -1.1447144
objectReference: {fileID: 0}
- target: {fileID: 1345146977094083068, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1345146977094083068, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1345146977094083068, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1345146977094083068, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1362765506118912221, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: PuzzleData
value:
objectReference: {fileID: 11400000, guid: 9636f1322f95ff04ea18314a36b04707, type: 2}
- target: {fileID: 1362765506118912221, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: Clues.Array.size
value: 3
objectReference: {fileID: 0}
- target: {fileID: 1362765506118912221, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: Clues.Array.data[0]
value:
objectReference: {fileID: 2274155455258433594}
- target: {fileID: 1362765506118912221, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: Clues.Array.data[1]
value:
objectReference: {fileID: 2274155455258433593}
- target: {fileID: 1362765506118912221, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: Clues.Array.data[2]
value:
objectReference: {fileID: 2274155455258433592}
- target: {fileID: 1362827765924626667, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -2572,6 +2608,22 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2046148042728693542, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2046148042728693542, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2046148042728693542, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2046148042728693542, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2053382487452899574, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -3240,6 +3292,10 @@ PrefabInstance:
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3168215361997660756, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3182363450244950974, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -3584,6 +3640,22 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3925762732023910692, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3925762732023910692, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3925762732023910692, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3925762732023910692, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3981998471100249076, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -3976,6 +4048,22 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4500690850336022560, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4500690850336022560, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4500690850336022560, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4500690850336022560, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4514669364589064069, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand All @@ -3996,6 +4084,22 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4581601237892739508, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4581601237892739508, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4581601237892739508, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4581601237892739508, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4617854793494524283, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -4294,7 +4398,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5068986546201449257, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0.08129883
value: 0.08703613
objectReference: {fileID: 0}
- target: {fileID: 5078577928483592518, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
Expand Down Expand Up @@ -4448,6 +4552,10 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5418539812907695742, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5486910667021444496, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -4572,6 +4680,18 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5811394046182290451, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5811394046182290451, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5811394046182290451, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5820875086643345666, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -4876,6 +4996,22 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6429916305000920582, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6429916305000920582, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6429916305000920582, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6429916305000920582, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6490326604673804209, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -6354,6 +6490,39 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
--- !u!114 &2274155455258433592 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1373104782645598674, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
m_PrefabInstance: {fileID: 2274155455258433590}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &2274155455258433593 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1095402699541872365, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
m_PrefabInstance: {fileID: 2274155455258433590}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &2274155455258433594 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1325388968946820784, guid: 005d4cd2f1886f44ea44c831dcfb1f5f, type: 3}
m_PrefabInstance: {fileID: 2274155455258433590}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &7306638882126709139
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
20 changes: 20 additions & 0 deletions Assets/Project/Scripts/Data/CelestialData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ public class CelestialData : ScriptableObject
[SerializeField] private bool m_useOverrideFocusVisual;
[SerializeField] private GameObject m_overrideFocusVisual;

public static DataPayload ToPayload(CelestialData inData, DraggableFlags mask) {
DataPayload outData = new DataPayload();
if (mask.HasFlag(DraggableFlags.Name)) {
outData.Name = inData.Name;
}
if (mask.HasFlag(DraggableFlags.Coords)) {
outData.Coordinates = new EqCoordinates(inData.RA, inData.Decl);
}
if (mask.HasFlag(DraggableFlags.Color)) {
outData.Color = inData.OverrideMat.color;
}
if (mask.HasFlag(DraggableFlags.Magnitude)) {
outData.Magnitude = inData.Magnitude;
}
if (mask.HasFlag(DraggableFlags.Spectrum)) {
outData.Spectrum = inData.Spectrum;
}
return outData;
}


public string Name { get { return m_name; } }
public Vector3 RA { get { return m_rightAscension; } }
Expand Down
6 changes: 5 additions & 1 deletion Assets/Project/Scripts/Data/PuzzleData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ public struct PuzzleObjectRef {
[CreateAssetMenu(menuName = "AstroLab/Create Puzzle Data")]

public class PuzzleData : ScriptableObject {
[SerializeField] private PuzzleObjectRef[] m_PuzzleObjects;
[SerializeField] private PuzzleObjectRef[] m_PuzzleRefs;
[SerializeField] private string[] m_Clues;


public PuzzleObjectRef[] PuzzleRefs { get { return m_PuzzleRefs; } }
public string[] Clues { get { return m_Clues; } }
}


Expand Down
Loading

0 comments on commit 674e2d7

Please sign in to comment.