Skip to content

Commit

Permalink
Merge pull request #15 from capriccioso-studio/ashley-branch
Browse files Browse the repository at this point in the history
Ashley branch
  • Loading branch information
DNAniel213 committed Aug 14, 2023
2 parents d29bc2c + a89be86 commit 71f8779
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 38 deletions.
44 changes: 23 additions & 21 deletions Assets/--Scenes--/Main Menu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1749,13 +1749,13 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 183633781}
m_TargetAssemblyTypeName: settingsMenu, Assembly-CSharp
m_MethodName: SetVolume
m_Mode: 0
m_MethodName: SetMusicVolume
m_Mode: 4
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_FloatArgument: 1
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
Expand Down Expand Up @@ -2103,7 +2103,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &183633780
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -6852,7 +6852,7 @@ RectTransform:
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -7906,7 +7906,7 @@ PrefabInstance:
- target: {fileID: 2093938874483115515, guid: 5746ee10fe8d58946ac4d8e0d04c63a3,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: -59.81105
objectReference: {fileID: 0}
- target: {fileID: 2093938874483115515, guid: 5746ee10fe8d58946ac4d8e0d04c63a3,
type: 3}
Expand Down Expand Up @@ -8200,8 +8200,8 @@ RectTransform:
m_Father: {fileID: 607040963}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0.8999996}
m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -9808,7 +9808,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 205.7998, y: -57.69995}
m_AnchoredPosition: {x: 205.7998, y: -57.699707}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &939804728
Expand Down Expand Up @@ -12248,7 +12248,7 @@ RectTransform:
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -13487,8 +13487,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0.00054276566, y: -0.00057504297}
m_SizeDelta: {x: -0.00048828, y: 0}
m_AnchoredPosition: {x: 0.00054276566, y: 0.00047172466}
m_SizeDelta: {x: -0.00048828, y: 266}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1289423681
MonoBehaviour:
Expand Down Expand Up @@ -14024,6 +14024,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
SeedItemTemplate: {fileID: 0}
PlatformItemTemplate: {fileID: 0}
orb: {fileID: 0}
SeedShopScrollView: {fileID: 0}
PlatformShopScrollView: {fileID: 0}
--- !u!114 &1353649800
Expand Down Expand Up @@ -17017,7 +17018,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1637995701
RectTransform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -17150,13 +17151,13 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 183633781}
m_TargetAssemblyTypeName: settingsMenu, Assembly-CSharp
m_MethodName: SetVolume
m_Mode: 0
m_MethodName: SetSFXVolume
m_Mode: 4
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_FloatArgument: 1
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
Expand Down Expand Up @@ -17537,8 +17538,8 @@ RectTransform:
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: 14, y: 2.9}
m_SizeDelta: {x: 207.1, y: 50}
m_AnchoredPosition: {x: 17.57, y: 2.9}
m_SizeDelta: {x: 199.95, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1683471494
MonoBehaviour:
Expand All @@ -17560,7 +17561,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 10000000
m_text: 0
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 53098aaa77fb24724a86f5b853301a31, type: 2}
m_sharedMaterial: {fileID: 6786922906145594891, guid: 53098aaa77fb24724a86f5b853301a31,
Expand Down Expand Up @@ -21262,8 +21263,8 @@ RectTransform:
m_Father: {fileID: 2145445546}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0.8999996}
m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -23603,6 +23604,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
SeedItemTemplate: {fileID: 2050213609}
PlatformItemTemplate: {fileID: 361975254}
orb: {fileID: 1683471492}
SeedShopScrollView: {fileID: 1289423680}
PlatformShopScrollView: {fileID: 657264032}
--- !u!1001 &2125396101
Expand Down
12 changes: 4 additions & 8 deletions Assets/--Scripts--/AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ public class AudioManager : MonoBehaviour

void Awake()
{
if(instance == null){
instance = this;
DontDestroyOnLoad(gameObject);
}
else
{
Destroy(gameObject);
}
if(instance != null)
Destroy(this);
instance = this;

LoadVolume();
}

Expand Down
6 changes: 6 additions & 0 deletions Assets/--Scripts--/Shop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ public class Shop : MonoBehaviour
public GameObject SeedItemTemplate, PlatformItemTemplate;
GameObject seedItem, platformItem;

public GameObject orb;

int sID=1, pID=1;

[SerializeField] Transform SeedShopScrollView;
[SerializeField] Transform PlatformShopScrollView;

public void Awake()
{
/***SHOWS ORB TOTAL***/
orb.gameObject.GetComponent<TMP_Text>().text = Global.orb + "";

/***DISPLAYS SHOP LIST***/
SeedItemTemplate = SeedShopScrollView.GetChild(0).gameObject;
PlatformItemTemplate = PlatformShopScrollView.GetChild(0).gameObject;

Expand Down
11 changes: 2 additions & 9 deletions Assets/--Scripts--/settingsMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,20 @@ void Awake()
{
musicSlider.onValueChanged.AddListener(SetMusicVolume);
sfxSlider.onValueChanged.AddListener(SetSFXVolume);
}

void onStart()
{
musicSlider.value = PlayerPrefs.GetFloat(AudioManager.MUSIC_KEY, 1f);
sfxSlider.value = PlayerPrefs.GetFloat(AudioManager.SFX_KEY, 1f);
}

void onDisable()
{
PlayerPrefs.SetFloat(AudioManager.MUSIC_KEY, musicSlider.value);
PlayerPrefs.SetFloat(AudioManager.SFX_KEY, sfxSlider.value);
}

public void SetMusicVolume (float volume)
{
audioMixer.SetFloat("MusicVolume", Mathf.Log10(volume) * 20);
PlayerPrefs.SetFloat(AudioManager.MUSIC_KEY, musicSlider.value);
}

public void SetSFXVolume (float volume)
{
audioMixer.SetFloat("SFXVolume", Mathf.Log10(volume) * 20);
PlayerPrefs.SetFloat(AudioManager.SFX_KEY, sfxSlider.value);
}
}

0 comments on commit 71f8779

Please sign in to comment.