Skip to content

Commit

Permalink
Tweaked reward preview during countdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Frib authored and Frib committed Oct 2, 2023
1 parent 0bd5836 commit 50c0740
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 11 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 84 additions & 8 deletions UnityGame/Assets/Prefabs/GameFlow.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6176846613998591507}
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: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2948036191422576001}
m_Father: {fileID: 8358367145219631100}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 200, y: 400}
m_SizeDelta: {x: -96, y: -96}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5756494512384636907
CanvasRenderer:
Expand Down Expand Up @@ -106,7 +106,7 @@ MonoBehaviour:
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_fontColor: {r: 0.42352945, g: 0.46274513, b: 0.7960785, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
Expand All @@ -123,7 +123,7 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 320
m_fontSize: 297.15
m_fontSizeBase: 320
m_fontWeight: 400
m_enableAutoSizing: 1
Expand Down Expand Up @@ -329,7 +329,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6387659362747331951}
- {fileID: 8358367145219631100}
m_Father: {fileID: 6439230126030169747}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
Expand Down Expand Up @@ -417,6 +417,82 @@ MonoBehaviour:
timePerSecond: 0.66
RewardParent: {fileID: 6116649303755581382}
Reward: {fileID: 0}
--- !u!1 &8125953361720371374
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8358367145219631100}
- component: {fileID: 611367290841035894}
- component: {fileID: 5886336233011353872}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8358367145219631100
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8125953361720371374}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.4, y: 0.4, z: 0.4}
m_ConstrainProportionsScale: 1
m_Children:
- {fileID: 6387659362747331951}
m_Father: {fileID: 2948036191422576001}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 887, y: 396}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &611367290841035894
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8125953361720371374}
m_CullTransparentMesh: 1
--- !u!114 &5886336233011353872
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8125953361720371374}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
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
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 841ad18ba7fa0a94b92928278807f14f, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1001 &1096259528142030851
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
8 changes: 5 additions & 3 deletions UnityGame/Assets/Scripts/CountdownCanvasScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ public void StartCountdown()
var rewardInstance = Instantiate(MinigameManager.Instance.NextModuleReward, RewardParent);
rewardInstance.transform.localPosition = Vector3.zero;
Reward = rewardInstance.GetComponent<Module>();
rewardInstance.AddComponent<RotatorScript>().RotatoSpeed = new Vector3(0, 90, 0);
RewardParent.position = Camera.main.transform.position + (Camera.main.transform.forward * 1.5f);
rewardInstance.SetActive(false);

//rewardInstance.AddComponent<RotatorScript>().RotatoSpeed = new Vector3(0, 90, 0);
//RewardParent.position = Camera.main.transform.position + (Camera.main.transform.forward * 1.5f) + (Camera.main.transform.up * -.4f);
startTime = Time.time;
gameObject.SetActive(true);
}
Expand All @@ -38,7 +40,7 @@ void Update()
startTime += timePerSecond;
countdownTime--;
}
text.text = countdownTime <= 0 ? "GOO!!!" : countdownTime > 3 ? $"\n\n\n\nReward: {Reward.DisplayName}" : countdownTime.ToString();
text.text = countdownTime <= 0 ? "GOO!!!" : countdownTime > 3 ? $"Reward:\n{Reward.ToStatsString(true)}" : countdownTime.ToString();

if (countdownTime == 0)
{
Expand Down

0 comments on commit 50c0740

Please sign in to comment.