Partial upscale + bugfixes

- Fixed a bug where the game's resolution would appear blurry.
- Fixed a bug where Ann Glerr's expression changed too soon upon reeling in a fish.
- Fixed bugs where certain distractions would fail to show up.

- Implemented the completed upscale of one texture sheet, for approximately 1/3 of the sprites in the game.
- Changed the game icon to something slightly less temporary but still probably not final.
This commit is contained in:
playinful 2024-04-12 12:57:48 -04:00
parent 818eed711d
commit 083644ff69
18 changed files with 11889 additions and 1546 deletions

View file

@ -101,6 +101,7 @@ MonoBehaviour:
LakeSceneHolder: {fileID: 4634833702056322427}
AnglerTransform: {fileID: 4349535315128336147}
_StickyCanvas: {fileID: 2247341267177786474}
DummyLake: {fileID: 4079413051522356860}
--- !u!1 &1618518225377962056
GameObject:
m_ObjectHideFlags: 0
@ -2785,6 +2786,10 @@ PrefabInstance:
propertyPath: m_Layer
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2294274867986435027, guid: 85290dc3ea9c9e241b6da3b302a5da7c, type: 3}
propertyPath: m_SortingOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2305343065259370281, guid: 85290dc3ea9c9e241b6da3b302a5da7c, type: 3}
propertyPath: m_Layer
value: 0
@ -5541,6 +5546,10 @@ PrefabInstance:
propertyPath: m_Layer
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7782910352286325046, guid: 85290dc3ea9c9e241b6da3b302a5da7c, type: 3}
propertyPath: m_SortingOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7783248265105004548, guid: 85290dc3ea9c9e241b6da3b302a5da7c, type: 3}
propertyPath: m_Layer
value: 0
@ -6143,6 +6152,17 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 85290dc3ea9c9e241b6da3b302a5da7c, type: 3}
--- !u!114 &4079413051522356860 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6727980822855321933, guid: 85290dc3ea9c9e241b6da3b302a5da7c, type: 3}
m_PrefabInstance: {fileID: 7332540138187890481}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f97884e1d9b26444992770441a9e7dae, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &5603933457609349627 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2884346302206887626, guid: 85290dc3ea9c9e241b6da3b302a5da7c, type: 3}

File diff suppressed because it is too large Load diff

View file

@ -530,7 +530,7 @@ RectTransform:
m_GameObject: {fileID: 1502420566489765567}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 0.8, y: 0.8, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4234368678986115320}
@ -3368,7 +3368,7 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6210502813140949400}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.228, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
@ -3470,9 +3470,49 @@ MonoBehaviour:
m_EditorClassIdentifier:
RenderCamera: {fileID: 6517132326795734953}
DisplaySprite: {fileID: 7075225906441527770}
TargetObject: {fileID: 4226582005766503027}
Size: {x: 1024, y: 1024}
Depth: 32
CullingObjects:
- {fileID: 5591256902133385207}
- {fileID: 3539241039120272600}
- {fileID: 4664630319896931766}
- {fileID: 4587311198770127423}
- {fileID: 7018651090977989474}
- {fileID: 1618138453731092631}
- {fileID: 5415457246764977725}
- {fileID: 3942568644305670061}
- {fileID: 4888599724276229922}
- {fileID: 7683121980294599276}
- {fileID: 4966438165405670359}
- {fileID: 8381366057153492176}
- {fileID: 884716136293995647}
- {fileID: 5711350171990415822}
- {fileID: 2276149498906492204}
- {fileID: 1772167332641020603}
- {fileID: 8198898060289374685}
- {fileID: 460882093399723472}
- {fileID: 6961049091512896761}
- {fileID: 4538369614261927076}
- {fileID: 1259709422392105212}
- {fileID: 3490620394027579423}
- {fileID: 6210502813140949400}
- {fileID: 4778099740768606843}
- {fileID: 1730402622545323636}
- {fileID: 4209653684135781082}
- {fileID: 3871281793734551029}
- {fileID: 8304651195384702191}
- {fileID: 1775019397122441880}
- {fileID: 4869679276725839985}
- {fileID: 1341318620033203348}
- {fileID: 2380046786320163898}
- {fileID: 2739518548447466703}
- {fileID: 7164674410252626480}
- {fileID: 2884346302206887626}
CullingSprites:
- {fileID: 2294274867986435027}
- {fileID: 626225649963419516}
- {fileID: 5894806610344834440}
- {fileID: 2614156096326041247}
- {fileID: 107606751081461738}
Depth: 24
--- !u!1 &6882672146990045156
GameObject:
m_ObjectHideFlags: 0
@ -4021,7 +4061,6 @@ MonoBehaviour:
FishOut: 0
_MultiSound: {fileID: 0}
Renderer: {fileID: 4226582005766503027}
CrossfadeAnimator: {fileID: 0}
RenderCamera: {fileID: 6517132326795734953}
DisplaySprite: {fileID: 7075225906441527770}
SchoolFishPrefab: {fileID: 6469500009000541928, guid: b02d8e694d2852f4ca61da67d5a45cf5, type: 3}
@ -4401,7 +4440,7 @@ SpriteRenderer:
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1.66, y: 1.18}
m_Size: {x: 1.58, y: 1.18}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
@ -4811,6 +4850,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0aa7b17762738384287534bd5ca0457f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2276149498906492204 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1687771926012107741, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 647016925596296945}
m_PrefabAsset: {fileID: 0}
--- !u!4 &6290269215436591226 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6895341918389630603, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
@ -4983,6 +5027,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0aa7b17762738384287534bd5ca0457f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1772167332641020603 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1687771926012107741, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 1149591442101535078}
m_PrefabAsset: {fileID: 0}
--- !u!4 &5784037690759706605 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6895341918389630603, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
@ -5081,6 +5130,11 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
--- !u!1 &460882093399723472 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1687771926012107741, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 1227594070889190925}
m_PrefabAsset: {fileID: 0}
--- !u!114 &975455731676400147 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2053863103930113054, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
@ -5268,6 +5322,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0aa7b17762738384287534bd5ca0457f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &884716136293995647 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1687771926012107741, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 1957675216230944674}
m_PrefabAsset: {fileID: 0}
--- !u!4 &4943302907512584489 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6895341918389630603, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
@ -5517,6 +5576,11 @@ Transform:
m_CorrespondingSourceObject: {fileID: 6895341918389630603, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 6016948385408778250}
m_PrefabAsset: {fileID: 0}
--- !u!1 &4966438165405670359 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1687771926012107741, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 6016948385408778250}
m_PrefabAsset: {fileID: 0}
--- !u!114 &5692751350600801300 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2053863103930113054, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
@ -5637,6 +5701,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0aa7b17762738384287534bd5ca0457f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &5711350171990415822 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1687771926012107741, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 6354263683808281107}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6890028140641755250
PrefabInstance:
m_ObjectHideFlags: 0
@ -5802,6 +5871,11 @@ Transform:
m_CorrespondingSourceObject: {fileID: 6895341918389630603, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 7150787782748827405}
m_PrefabAsset: {fileID: 0}
--- !u!1 &8381366057153492176 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1687771926012107741, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 7150787782748827405}
m_PrefabAsset: {fileID: 0}
--- !u!114 &9204365906270712595 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2053863103930113054, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
@ -5911,6 +5985,11 @@ Transform:
m_CorrespondingSourceObject: {fileID: 6895341918389630603, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 7396174783831597568}
m_PrefabAsset: {fileID: 0}
--- !u!1 &8198898060289374685 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1687771926012107741, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}
m_PrefabInstance: {fileID: 7396174783831597568}
m_PrefabAsset: {fileID: 0}
--- !u!114 &8801357874890735134 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2053863103930113054, guid: aa9f82e1eed46a042a40344a77ab13ba, type: 3}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 KiB

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 25 KiB

View file

@ -2666,6 +2666,8 @@ AnimationClip:
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: -1310042000, guid: 33543f0af5319714383cc50d7cd73e18, type: 3}
- time: 0.53333336
value: {fileID: 1686235048, guid: 33543f0af5319714383cc50d7cd73e18, type: 3}
- time: 1.5333333
@ -2951,6 +2953,7 @@ AnimationClip:
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: -1310042000, guid: 33543f0af5319714383cc50d7cd73e18, type: 3}
- {fileID: 1686235048, guid: 33543f0af5319714383cc50d7cd73e18, type: 3}
- {fileID: -1310042000, guid: 33543f0af5319714383cc50d7cd73e18, type: 3}
- {fileID: -14744940, guid: 33543f0af5319714383cc50d7cd73e18, type: 3}

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 689e01f6a3b71e44e9c266092b2b27e8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9ceb45f91551a3042b049a575c0e75bd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -141,6 +141,12 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: 6195784825912013836}
m_Position: {x: 480, y: 410, z: 0}
- serializedVersion: 1
m_State: {fileID: 2971140335904492394}
m_Position: {x: 480, y: 130, z: 0}
- serializedVersion: 1
m_State: {fileID: 8876985782714239577}
m_Position: {x: 940, y: 130, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
@ -345,6 +351,28 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-6601277441343936456
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 4586150421227050101}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-6225093502531867141
AnimatorState:
serializedVersion: 6
@ -894,6 +922,28 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1917538273381952540
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -3481407283309479541}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &2073938479257593203
AnimatorState:
serializedVersion: 6
@ -1043,6 +1093,33 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &2971140335904492394
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Fish1_JustM
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1917538273381952540}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 689e01f6a3b71e44e9c266092b2b27e8, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &3429756437907627661
AnimatorState:
serializedVersion: 6
@ -1378,3 +1455,30 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &8876985782714239577
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Fish2_JustM
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -6601277441343936456}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 9ceb45f91551a3042b049a575c0e75bd, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 789 KiB

View file

@ -8,6 +8,7 @@ using Jukebox;
using HeavenStudio.Games.Scripts_CatchOfTheDay;
using HeavenStudio.Common;
using BezierSolution;
namespace HeavenStudio.Games.Loaders
{
@ -26,6 +27,7 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 3f,
parameters = new List<Param>()
{
new Param("altSprite", CatchOfTheDay.MegamixOrFever.Fever, "Sprite Variant", "Select whether to use the Fever or the Megamix variant of the reeling sprite."),
new Param("layout", CatchOfTheDay.FishLayout.Random, "Layout", "Set the layout for the scene."),
new Param("useCustomColor", false, "Custom Color", "Set whether or not to use a custom color.", new List<Param.CollapseParam>()
{
@ -41,6 +43,7 @@ namespace HeavenStudio.Games.Loaders
new Param.CollapseParam((x, _) => (bool)x, new string[] { "fishDensity" })
}),
new Param("fishDensity", new EntityTypes.Float(0f, 1f, 1f), "Fish Density", "Set the density for the fish in the school."),
new Param("crossfade", true, "Crossfade", "Set whether or not this scene will fade smoothly into the next one."),
},
},
new GameAction("fish2", "Pausegill")
@ -50,6 +53,7 @@ namespace HeavenStudio.Games.Loaders
defaultLength = 4f,
parameters = new List<Param>()
{
new Param("altSprite", CatchOfTheDay.MegamixOrFever.Fever, "Sprite Variant", "Select whether to use the Fever or the Megamix variant of the reeling sprite."),
new Param("countIn", false, "Count-In", "Play the \"And Go!\" sound effect as a count in to the cue."),
new Param("layout", CatchOfTheDay.FishLayout.Random, "Layout", "Set the layout for the scene."),
new Param("useCustomColor", false, "Custom Color", "Set whether or not to use a custom color.", new List<Param.CollapseParam>()
@ -66,6 +70,7 @@ namespace HeavenStudio.Games.Loaders
new Param.CollapseParam((x, _) => (bool)x, new string[] { "fishDensity" })
}),
new Param("fishDensity", new EntityTypes.Float(0f, 1f, 1f), "Fish Density", "Set the density for the fish in the school."),
new Param("crossfade", true, "Crossfade", "Set whether or not this scene will fade smoothly into the next one."),
},
},
new GameAction("fish3", "Threefish")
@ -92,6 +97,7 @@ namespace HeavenStudio.Games.Loaders
new Param.CollapseParam((x, _) => (bool)x, new string[] { "fishDensity" })
}),
new Param("fishDensity", new EntityTypes.Float(0f, 1f, 1f), "Fish Density", "Set the density for the fish in the school."),
new Param("crossfade", true, "Crossfade", "Set whether or not this scene will fade smoothly into the next one."),
},
},
new GameAction("moveAngler", "Move Angler")
@ -153,12 +159,9 @@ namespace HeavenStudio.Games
{
/*
BIG LIST OF TODOS
- fix the distractions
- optimise fish school
- make rendertex not blurry
- final sfx
- wait for upscale
- remove unused
*/
protected const int MAX_LAKES = 50;
@ -182,7 +185,7 @@ namespace HeavenStudio.Games
public static Dictionary<RiqEntity, MultiSound> FishSounds = new();
private List<RiqEntity> _AllFishes;
[SerializeField] Transform AnglerTransform;
private bool _AnglerIsMoving = false;
private AnglerMoveArgs _CurrentAnglerMoveArgs;
@ -197,6 +200,8 @@ namespace HeavenStudio.Games
[SerializeField] StickyCanvas _StickyCanvas;
[SerializeField] LakeScene DummyLake;
void Awake()
{
_AnglerBasePosition = AnglerTransform.localPosition;
@ -494,10 +499,16 @@ namespace HeavenStudio.Games
if (ActiveLakes.Count <= 0)
{
if (SpawnNextFish(conductor.songPositionInBeatsAsDouble))
{
lake.Crossfade(beat);
DummyLake.Copy(ActiveLakes.Values.FirstOrDefault());
}
}
else
{
lake.Crossfade(beat);
DummyLake.Copy(ActiveLakes.Values.FirstOrDefault());
}
}
public List<RiqEntity> CacheFishes()
@ -512,7 +523,13 @@ namespace HeavenStudio.Games
LayoutB = 1,
LayoutC = 2
}
public enum MegamixOrFever : int
{
Random = 0,
Fever = 1,
Megamix = 2
}
private struct AnglerMoveArgs
{
public Vector3 StartPosition;

View file

@ -11,9 +11,9 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
[SerializeField] Camera RenderCamera;
[SerializeField] SpriteRenderer DisplaySprite;
[SerializeField] GameObject TargetObject;
[SerializeField] Vector2Int Size = new Vector2Int(1024, 1024);
[SerializeField] int Depth = 32;
[SerializeField] GameObject[] CullingObjects;
[SerializeField] SpriteRenderer[] CullingSprites;
[SerializeField] int Depth = 24;
private RenderTexture _RenderTexture;
private Texture2D _DisplayTexture;
@ -52,12 +52,12 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
RenderTexture.active = currentRenderTexture;
}
protected static void CullInstances(DynamicTextureRenderer currentInstance)
/*protected static void CullInstances(DynamicTextureRenderer currentInstance)
{
foreach (DynamicTextureRenderer instance in Instances)
{
if (instance != null && instance.isActiveAndEnabled)
instance.TargetObject.SetActive(instance == currentInstance);
instance.CullObjectsAndSprites();
}
}
protected static void RestoreCulledInstances()
@ -65,10 +65,49 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
foreach (DynamicTextureRenderer instance in Instances)
{
if (instance != null && instance.isActiveAndEnabled)
instance.TargetObject.SetActive(true);
instance.RestoreObjectsAndSprites();
}
}
protected void CullObjectsAndSprites()
{
CullObjects();
CullSprites();
}
protected void CullObjects()
{
foreach (GameObject gameObject in CullingObjects)
{
gameObject.SetActive(false);
}
}
protected void CullSprites()
{
foreach (SpriteRenderer spriteRenderer in CullingSprites)
{
spriteRenderer.enabled = false;
}
}
protected void RestoreObjectsAndSprites()
{
RestoreObjects();
RestoreSprites();
}
protected void RestoreObjects()
{
foreach (GameObject gameObject in CullingObjects)
{
gameObject.SetActive(true);
}
}
protected void RestoreSprites()
{
foreach (SpriteRenderer spriteRenderer in CullingSprites)
{
spriteRenderer.enabled = true;
}
}*/
protected static void AddInstance(DynamicTextureRenderer instance)
{
TrimInstances();
@ -90,16 +129,18 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
if (_DisplayTexture != null) Destroy(_DisplayTexture);
if (DisplaySprite.sprite != null) Destroy(DisplaySprite.sprite);
int width = _GameTexture.width;
int height = _GameTexture.height;
Debug.Log($"{width} x {height}");
int width = (int)(_GameTexture.width * 2);
int height = (int)(_GameTexture.height * 2);
//Debug.Log($"{width} x {height}");
_RenderTexture = new RenderTexture(width, height, Depth);
_RenderTexture.Create();
_RenderTexture = new RenderTexture(width * 2, height * 2, Depth);
RenderCamera.targetTexture = _RenderTexture;
_DisplayTexture = new Texture2D(width * 2, height * 2, TextureFormat.RGBA32, false);
Sprite sprite = Sprite.Create(_DisplayTexture, new Rect(0, 0, width * 2, height * 2), new Vector2(0.5f, 0.5f));
_DisplayTexture = new Texture2D(width, height, TextureFormat.RGBA32, false);
Sprite sprite = Sprite.Create(_DisplayTexture, new Rect(0, 0, width, height), new Vector2(0.5f, 0.5f));
DisplaySprite.sprite = sprite;
DisplaySprite.transform.localScale = new Vector3(17.77695f / (width / 50), 10 / (height / 50), 1);
DisplaySprite.transform.localScale = new Vector3(1600 / (float)width, 900 / (float)height, 1);
}
}
}

View file

@ -1,16 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
namespace HeavenStudio.Games.Scripts_CatchOfTheDay
{
public class FishParticleSystem : MonoBehaviour
{
[SerializeField] ParticleSystem _ParticleSystem;
void Update()
{
}
}
}

View file

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

View file

@ -3,6 +3,7 @@ using System.Linq;
using HeavenStudio.Util;
using Jukebox;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Rendering;
namespace HeavenStudio.Games.Scripts_CatchOfTheDay
@ -36,13 +37,14 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
public MultiSound _MultiSound;
private RenderTexture _RenderTexture;
private Texture2D _DisplayTexture;
private double? _CrossfadeStartBeat;
[SerializeField] GameObject Renderer;
[SerializeField] Camera RenderCamera;
[SerializeField] SpriteRenderer DisplaySprite;
[SerializeField] Animator CrossfadeAnimator;
protected CatchOfTheDay.FishLayout _Layout;
protected Color _TopColor;
protected Color _BottomColor;
void Update()
{
@ -51,10 +53,7 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
if (BigManta.activeSelf)
BigManta.transform.localPosition = new Vector3((float)Entity.beat - Conductor.instance.songPositionInBeats + 4.5f, BigManta.transform.localPosition.y, BigManta.transform.localPosition.z);
if (SmallManta.activeSelf)
SmallManta.transform.localPosition = new Vector3(1.25f + ((Conductor.instance.songPositionInBeats - (float)Entity.beat) * 0.13f), SmallManta.transform.localPosition.y, SmallManta.transform.localPosition.y);
if (!IsDummy)
RenderScene();
SmallManta.transform.localPosition = new Vector3(1.25f + ((Conductor.instance.songPositionInBeats - (float)Entity.beat) * 0.13f), SmallManta.transform.localPosition.y, SmallManta.transform.localPosition.z);
if (_CrossfadeStartBeat is double startBeat)
{
@ -71,7 +70,7 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
ReelAction.Disable();
}
public int Setup(RiqEntity e, CatchOfTheDay minigame, int? lastLayout = null, int sortingIndex = 0)
public int Setup(RiqEntity e, CatchOfTheDay minigame, int? lastLayout, int sortingIndex)
{
Entity = e;
Minigame = minigame;
@ -156,6 +155,7 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
BGAnimator.DoScaledAnimationAsync("LayoutA", 0.5f);
break;
}
_Layout = (CatchOfTheDay.FishLayout)layout;
if (e["useCustomColor"])
{
@ -166,6 +166,10 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
SetBGColors(TopColors[layout], BottomColors[layout]);
}
DisplaySprite.sortingOrder = sortingIndex;
Renderer.transform.localPosition -= new Vector3(0, 0, sortingIndex);
RenderCamera.transform.localPosition -= new Vector3(0, 0, sortingIndex);
float xOffset = UnityEngine.Random.Range(-0.5f, 0.5f);
float yOffset = UnityEngine.Random.Range(-0.3f, 0.3f);
Renderer.transform.position += new Vector3(xOffset, yOffset, 0);
@ -184,14 +188,33 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
foreach (ParticleSystem particle in Bubbles.OrderBy(_ => UnityEngine.Random.Range(0.0f, 1.0f)).ToArray()[0..bubbleCount])
particle.PlayScaledAsync(0.5f);
DisplaySprite.sortingOrder = sortingIndex;
Renderer.transform.localPosition -= new Vector3(0, 0, sortingIndex);
RenderCamera.transform.localPosition -= new Vector3(0, 0, sortingIndex);
_DynamicTextureRenderer.enabled = true;
return layout; // returning this so we can catalogue the most recent layout so we don't double up
}
public void Copy(LakeScene otherScene)
{
if (otherScene == null)
return;
switch (otherScene._Layout)
{
case CatchOfTheDay.FishLayout.LayoutC:
BGAnimator.DoScaledAnimationAsync("LayoutC", 0.5f);
break;
case CatchOfTheDay.FishLayout.LayoutB:
BGAnimator.DoScaledAnimationAsync("LayoutB", 0.5f);
break;
case CatchOfTheDay.FishLayout.LayoutA:
default:
BGAnimator.DoScaledAnimationAsync("LayoutA", 0.5f);
break;
}
SetBGColors(otherScene._TopColor, otherScene._BottomColor);
Renderer.transform.localPosition = new Vector3(otherScene.Renderer.transform.localPosition.x, otherScene.Renderer.transform.localPosition.y, Renderer.transform.localPosition.z);
}
public void SetBGColors(Color topColor, Color bottomColor)
{
GradientBG.color = topColor;
@ -201,6 +224,9 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
{
fish.SetColor(bottomColor);
}
_TopColor = topColor;
_BottomColor = bottomColor;
}
public void SetFishDensity(float density)
{
@ -219,7 +245,7 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
}
}
public void Hit(PlayerActionEvent caller, float state)
private void Hit(PlayerActionEvent caller, float state)
{
if (FishOut)
return;
@ -233,7 +259,7 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
Miss();
}
}
public void Just()
private void Just()
{
if (FishOut)
return;
@ -241,11 +267,17 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
switch (Entity.datamodel)
{
case "catchOfTheDay/fish1":
FishAnimator.DoScaledAnimationAsync("Fish1_Just", 0.5f);
if (Entity["altSprite"] == (int)CatchOfTheDay.MegamixOrFever.Megamix || (Entity["altSprite"] == (int)CatchOfTheDay.MegamixOrFever.Random && UnityEngine.Random.Range(0f, 1f) >= 0.5))
FishAnimator.DoScaledAnimationAsync("Fish1_JustM", 0.5f);
else
FishAnimator.DoScaledAnimationAsync("Fish1_Just", 0.5f);
SoundByte.PlayOneShotGame("catchOfTheDay/quick3");
break;
case "catchOfTheDay/fish2":
FishAnimator.DoScaledAnimationAsync("Fish2_Just", 0.5f);
if (Entity["altSprite"] == (int)CatchOfTheDay.MegamixOrFever.Megamix || (Entity["altSprite"] == (int)CatchOfTheDay.MegamixOrFever.Random && UnityEngine.Random.Range(0f, 1f) >= 0.5))
FishAnimator.DoScaledAnimationAsync("Fish2_JustM", 0.5f);
else
FishAnimator.DoScaledAnimationAsync("Fish2_Just", 0.5f);
SoundByte.PlayOneShotGame("catchOfTheDay/pausegill4");
break;
case "catchOfTheDay/fish3":
@ -258,7 +290,7 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
Minigame.DoJustAnim();
FishOut = true;
}
public void Miss()
private void Miss()
{
if (FishOut)
return;
@ -283,7 +315,7 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
SoundByte.PlayOneShotGame("catchOfTheDay/nearMiss");
FishOut = true;
}
public void Through(PlayerActionEvent caller)
private void Through(PlayerActionEvent caller)
{
if (FishOut)
return;
@ -307,7 +339,7 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
}
Minigame.DoThroughAnim();
}
public void Out(PlayerActionEvent caller)
private void Out(PlayerActionEvent caller)
{
if (FishOut)
return;
@ -389,37 +421,12 @@ namespace HeavenStudio.Games.Scripts_CatchOfTheDay
}
}
[SerializeField] Camera RenderCamera;
[SerializeField] SpriteRenderer DisplaySprite;
public void RenderScene()
{
/*if (!DisplaySprite.enabled)
return;
Rect rect = new Rect(0, 0, 1024, 1024);
if (_RenderTexture == null)
{
_RenderTexture = new RenderTexture(1024, 1024, 32);
RenderCamera.targetTexture = _RenderTexture;
_DisplayTexture = new Texture2D(1024, 1024, TextureFormat.RGBA32, false);
Sprite sprite = Sprite.Create(_DisplayTexture, new Rect(0, 0, 1024, 1024), new Vector2(0.5f, 0.5f));
DisplaySprite.sprite = sprite;
}
RenderCamera.Render();
RenderTexture currentRenderTexture = RenderTexture.active;
RenderTexture.active = _RenderTexture;
_DisplayTexture.ReadPixels(rect, 0, 0);
_DisplayTexture.Apply();
RenderTexture.active = currentRenderTexture;*/
}
public void Crossfade(double beat)
{
_CrossfadeStartBeat = beat;
if ((bool)Entity["crossfade"])
_CrossfadeStartBeat = beat;
else
Destroy(gameObject);
//CrossfadeAnimator.DoScaledAnimationAsync("Crossfade", 0.5f);
}