Merge branch 'sprechtl' into develop

# Conflicts:
#	Assets/Scenes/MainScene.unity
This commit is contained in:
s-prechtl 2022-06-03 11:01:50 +02:00
commit 9fcc02ae3e
2 changed files with 92 additions and 174 deletions

View file

@ -1007,109 +1007,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 44dae5fbdb6f7df4f93a10807f66956f, type: 3}
--- !u!1 &227697244
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 227697245}
- component: {fileID: 227697248}
- component: {fileID: 227697247}
- component: {fileID: 227697246}
m_Layer: 0
m_Name: Menu
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &227697245
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 227697244}
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:
- {fileID: 1040033584}
- {fileID: 880320857}
- {fileID: 1014076882}
m_Father: {fileID: 1395531171}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -115, y: -116}
m_SizeDelta: {x: -375.9581, y: -281.9686}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &227697246
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 227697244}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &227697247
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 227697244}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!223 &227697248
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 227697244}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &261459150 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3510585822996971025, guid: 44dae5fbdb6f7df4f93a10807f66956f, type: 3}
@ -1638,8 +1535,8 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 2006577139}
m_HandleRect: {fileID: 2006577138}
m_Direction: 2
m_Value: 1
m_Size: 0.5932421
m_Value: 0.9999998
m_Size: 0.59324205
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
@ -2744,8 +2641,8 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
rgba: 4280045691
m_fontColor: {r: 0.48235297, g: 0.3137255, b: 0.10980393, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
@ -2768,7 +2665,7 @@ MonoBehaviour:
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_fontStyle: 1
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
@ -2943,18 +2840,18 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 880320856}
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:
- {fileID: 2055507137}
m_Father: {fileID: 227697245}
m_RootOrder: 1
m_Father: {fileID: 1040033584}
m_RootOrder: 0
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: 50}
m_AnchoredPosition: {x: 0, y: 20}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &880320858
@ -3003,7 +2900,7 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 1278234714}
m_TargetAssemblyTypeName: HouseController, Assembly-CSharp
m_MethodName: newDay
m_MethodName: NewDay
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
@ -3033,7 +2930,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Sprite: {fileID: 21300000, guid: 349d3f5d7a4156146b8e923d5c06314d, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
@ -3432,7 +3329,7 @@ RectTransform:
m_Children:
- {fileID: 1609015287}
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -3470,18 +3367,18 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1014076881}
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:
- {fileID: 1894722677}
m_Father: {fileID: 227697245}
m_RootOrder: 2
m_Father: {fileID: 1040033584}
m_RootOrder: 1
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: -50}
m_AnchoredPosition: {x: 0, y: -20}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1014076883
@ -3530,7 +3427,7 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 1278234714}
m_TargetAssemblyTypeName: HouseController, Assembly-CSharp
m_MethodName: toggleMenu
m_MethodName: ToggleMenu
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
@ -3560,7 +3457,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Sprite: {fileID: 21300000, guid: 349d3f5d7a4156146b8e923d5c06314d, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
@ -3607,14 +3504,16 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 227697245}
m_Children:
- {fileID: 880320857}
- {fileID: 1014076882}
m_Father: {fileID: 1395531171}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: -290, y: -350}
m_SizeDelta: {x: 250, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1040033585
MonoBehaviour:
@ -3629,14 +3528,14 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.392}
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: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Sprite: {fileID: 21300000, guid: 2a61ecc3d143def478dfed9f6d6ca3fd, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
@ -3754,7 +3653,7 @@ RectTransform:
- {fileID: 1070476668}
- {fileID: 1649897726}
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -3821,7 +3720,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 2a61ecc3d143def478dfed9f6d6ca3fd, type: 3}
m_Sprite: {fileID: 21300000, guid: 349d3f5d7a4156146b8e923d5c06314d, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
@ -3906,8 +3805,8 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
rgba: 4280111227
m_fontColor: {r: 0.48235297, g: 0.3137255, b: 0.1137255, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
@ -3930,7 +3829,7 @@ MonoBehaviour:
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_fontStyle: 1
m_HorizontalAlignment: 4
m_VerticalAlignment: 512
m_textAlignment: 65535
@ -4906,7 +4805,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
menu: {fileID: 1395531174}
dayCountTextMeshProUGUI: {fileID: 0}
dayCountTextMeshProUGUI: {fileID: 1089918735}
menuPanel: {fileID: 1040033583}
--- !u!212 &1278234715
SpriteRenderer:
m_ObjectHideFlags: 0
@ -4967,13 +4867,12 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1278234712}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.52, y: 3.09, z: -1}
m_LocalPosition: {x: -7.27, y: -0.75, z: -1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1395531171}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!224 &1285197323 stripped
RectTransform:
@ -4996,7 +4895,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!114 &1291863650
MonoBehaviour:
m_ObjectHideFlags: 0
@ -5303,8 +5202,8 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
rgba: 4280045691
m_fontColor: {r: 0.48235297, g: 0.3137255, b: 0.10980393, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
@ -5327,7 +5226,7 @@ MonoBehaviour:
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_fontStyle: 1
m_HorizontalAlignment: 4
m_VerticalAlignment: 512
m_textAlignment: 65535
@ -5494,7 +5393,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1395531171
RectTransform:
m_ObjectHideFlags: 0
@ -5507,9 +5406,9 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 227697245}
m_Father: {fileID: 1278234716}
m_RootOrder: 0
- {fileID: 1040033584}
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -5573,7 +5472,7 @@ Canvas:
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
@ -6400,7 +6299,7 @@ RectTransform:
m_Children:
- {fileID: 1671356617}
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -6533,7 +6432,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 2a61ecc3d143def478dfed9f6d6ca3fd, type: 3}
m_Sprite: {fileID: 21300000, guid: 349d3f5d7a4156146b8e923d5c06314d, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
@ -6888,6 +6787,7 @@ MonoBehaviour:
startItems:
- {fileID: 11400000, guid: 008a8fdd2c3a95745acafee4087a855d, type: 2}
- {fileID: 11400000, guid: 430db451ae959f34b8fba8d8b17276fd, type: 2}
- {fileID: 11400000, guid: ea1a26b19bc34a0ba29bad77253c7266, type: 2}
--- !u!114 &1800469992
MonoBehaviour:
m_ObjectHideFlags: 0
@ -6905,6 +6805,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: d651d57ba97a4246a0094409e29fe56a, type: 2}
- {fileID: 11400000, guid: 430db451ae959f34b8fba8d8b17276fd, type: 2}
- {fileID: 11400000, guid: 008a8fdd2c3a95745acafee4087a855d, type: 2}
- {fileID: 11400000, guid: ea1a26b19bc34a0ba29bad77253c7266, type: 2}
--- !u!1001 &1805366398
PrefabInstance:
m_ObjectHideFlags: 0
@ -7249,8 +7150,8 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
rgba: 4280045691
m_fontColor: {r: 0.48235297, g: 0.3137255, b: 0.10980393, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
@ -7267,13 +7168,13 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 20
m_fontSizeBase: 20
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
@ -7761,8 +7662,8 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
rgba: 4280045691
m_fontColor: {r: 0.48235297, g: 0.3137255, b: 0.10980393, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
@ -7785,7 +7686,7 @@ MonoBehaviour:
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_fontStyle: 1
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
@ -7901,8 +7802,8 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
rgba: 4280045691
m_fontColor: {r: 0.48235297, g: 0.3137255, b: 0.10980393, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
@ -7919,13 +7820,13 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 20
m_fontSizeBase: 20
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
@ -8185,7 +8086,7 @@ RectTransform:
m_Children:
- {fileID: 590987454}
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}

View file

@ -6,28 +6,45 @@ using UnityEngine;
using UnityEngine.Events;
public class HouseController : MonoBehaviour {
private int dayCount = 1;
private static UnityEvent newDayEvent;
public static UnityEvent NewDayEvent => newDayEvent;
private int _dayCount = 1;
private static UnityEvent _newDayEvent;
public static UnityEvent NewDayEvent => _newDayEvent;
public Canvas menu;
public TextMeshProUGUI dayCountTextMeshProUGUI;
public GameObject menuPanel;
private void OnMouseDown() {
toggleMenu();
ToggleMenu();
}
void Start() {
newDayEvent ??= new UnityEvent();
_newDayEvent ??= new UnityEvent();
ToggleMenu();
}
public void newDay() {
dayCount++;
dayCountTextMeshProUGUI.text = dayCount.ToString();
newDayEvent?.Invoke();
public void NewDay() {
_dayCount++;
dayCountTextMeshProUGUI.text = _dayCount.ToString();
_newDayEvent?.Invoke();
}
public void toggleMenu() {
public void ToggleMenu() {
menu.gameObject.SetActive(!menu.gameObject.activeSelf);
float newPosY;
if (Camera.main != null) {
Vector3 pos = Camera.main.WorldToScreenPoint(transform.position);
if (pos.y - 50 - ((RectTransform)menuPanel.transform).rect.height >= 0) { //check if bottom of panel is in screen
newPosY = pos.y - ((RectTransform)menuPanel.transform).rect.height;
} else {
newPosY = pos.y + ((RectTransform)menuPanel.transform).rect.height;
}
menuPanel.transform.position = new Vector3(pos.x, newPosY);
}
}
}