Add font, start working on options

This commit is contained in:
Jens Pitkänen 2020-04-19 21:04:45 +03:00
parent 6e35630bd4
commit bccd148646
14 changed files with 2065 additions and 47 deletions

8
Assets/Fonts.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0d4bead24090a3147903a6014354def7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Fonts/Lemon.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 832f51e871d006d498beb2375788ce35
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,94 @@
Copyright (c) 2011, Eduardo Tunni (http://www.tipo.net.ar),
with Reserved Font Name "Lemon"
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: db209d86c3765fd45a05436250a8f630
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: a0bb3d007c7133149bd1682bd93b776f
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Lemon
fontNames:
- Lemon
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -117,7 +117,18 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1620308024928351744}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 9067262984299284594}
m_MethodName: Exit
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &531861614786402144
GameObject:
m_ObjectHideFlags: 0
@ -128,6 +139,7 @@ GameObject:
m_Component:
- component: {fileID: 531861614786402147}
- component: {fileID: 452814073520004166}
- component: {fileID: 9067262984299284594}
m_Layer: 5
m_Name: Game Over Screen
m_TagString: Untagged
@ -169,6 +181,19 @@ CanvasGroup:
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0
--- !u!114 &9067262984299284594
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 531861614786402144}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a7f3567286257eb4fb092e419d7e7e71, type: 3}
m_Name:
m_EditorClassIdentifier:
GameState: {fileID: 0}
--- !u!1 &1054245937653238256
GameObject:
m_ObjectHideFlags: 0
@ -572,7 +597,18 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 7235187371801203126}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 9067262984299284594}
m_MethodName: Replay
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &7230472725291673215
GameObject:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@ -571,31 +571,12 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 397359278}
m_PrefabAsset: {fileID: 0}
--- !u!1 &429180125 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 531861614786402144, guid: 0a942b74adc03b248ac74ce8af504ca5,
type: 3}
m_PrefabInstance: {fileID: 531861614376686525}
m_PrefabAsset: {fileID: 0}
--- !u!224 &429180126 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 531861614786402147, guid: 0a942b74adc03b248ac74ce8af504ca5,
type: 3}
m_PrefabInstance: {fileID: 531861614376686525}
m_PrefabAsset: {fileID: 0}
--- !u!114 &429180127
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 429180125}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a7f3567286257eb4fb092e419d7e7e71, type: 3}
m_Name:
m_EditorClassIdentifier:
GameState: {fileID: 834592896}
--- !u!1001 &483093624
PrefabInstance:
m_ObjectHideFlags: 0
@ -1500,7 +1481,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1921606960}
m_RootOrder: 2
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}
@ -1521,7 +1502,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.754717, g: 0.754717, b: 0.754717, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
@ -1833,7 +1814,7 @@ RectTransform:
m_Children:
- {fileID: 1849724585}
m_Father: {fileID: 1921606960}
m_RootOrder: 1
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}
@ -1850,7 +1831,7 @@ CanvasGroup:
m_Enabled: 1
m_Alpha: 0
m_Interactable: 1
m_BlocksRaycasts: 1
m_BlocksRaycasts: 0
m_IgnoreParentGroups: 0
--- !u!1001 &1442608327
PrefabInstance:
@ -2743,12 +2724,12 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.8301887, g: 0.8301887, b: 0.8301887, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Font: {fileID: 12800000, guid: a0bb3d007c7133149bd1682bd93b776f, type: 3}
m_FontSize: 28
m_FontStyle: 0
m_BestFit: 0
@ -2944,9 +2925,9 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1344354208}
- {fileID: 1364366412}
- {fileID: 1156509021}
- {fileID: 1344354208}
- {fileID: 429180126}
m_Father: {fileID: 0}
m_RootOrder: 5
@ -3505,6 +3486,11 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 9067262984299284594, guid: 0a942b74adc03b248ac74ce8af504ca5,
type: 3}
propertyPath: GameState
value:
objectReference: {fileID: 834592896}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0a942b74adc03b248ac74ce8af504ca5, type: 3}
--- !u!1001 &5400695019531174117
@ -3514,6 +3500,16 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 1921606960}
m_Modifications:
- target: {fileID: 3588221716476260827, guid: 2cd64e49ad7ad1c4bb4a4264703d7915,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3965423868489175230, guid: 2cd64e49ad7ad1c4bb4a4264703d7915,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5400695020334462788, guid: 2cd64e49ad7ad1c4bb4a4264703d7915,
type: 3}
propertyPath: m_Alpha
@ -3532,7 +3528,7 @@ PrefabInstance:
- target: {fileID: 5400695020334462789, guid: 2cd64e49ad7ad1c4bb4a4264703d7915,
type: 3}
propertyPath: m_RootOrder
value: 0
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5400695020334462789, guid: 2cd64e49ad7ad1c4bb4a4264703d7915,
type: 3}
@ -3559,6 +3555,16 @@ PrefabInstance:
propertyPath: m_Name
value: Pause Menu
objectReference: {fileID: 0}
- target: {fileID: 7729775465812122422, guid: 2cd64e49ad7ad1c4bb4a4264703d7915,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8904450836871494407, guid: 2cd64e49ad7ad1c4bb4a4264703d7915,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2cd64e49ad7ad1c4bb4a4264703d7915, type: 3}
--- !u!1001 &6125707629521091122

View File

@ -214,7 +214,7 @@ MonoBehaviour:
value: 100
lift:
overrideState: 1
value: {x: 1, y: 1, z: 1, w: -0.046656296}
value: {x: 1, y: 1, z: 1, w: -0.062208395}
gamma:
overrideState: 1
value: {x: 1, y: 1, z: 1, w: -8.647041e-10}

View File

@ -66,7 +66,7 @@ public class Campfire : MonoBehaviour {
if (Fuel >= GoodFuelAmount * 2) {
return false;
} else {
Fuel += burnable.Quality.FuelValue * Mathf.Max(0, (2 - Fuel / GoodFuelAmount));
Fuel += burnable.Quality.FuelValue * Mathf.Max(0.5f, (2 - Fuel / GoodFuelAmount));
Flame.AddFuelEffect += burnable.Quality.FlameEffect;
Sfx.ActiveBurn += burnable.Quality.SoundEffect;
Destroy(burnable.gameObject);

View File

@ -38,21 +38,26 @@ public class CampfireSfx : MonoBehaviour {
bool StopEndClip = Campfire.TimeToEnd > EndClip.length && AmbientSource.clip == EndClip;
if (StartEndClip) {
AmbientSource.clip = EndClip;
AmbientSource.time = Mathf.Clamp(EndClip.length - Campfire.TimeToEnd, 0, EndClip.length - 0.01f);
AmbientSource.Play();
AmbientSource.time = EndClip.length - Campfire.TimeToEnd;
} else if (StopEndClip || NeedsRefresh(AmbientSource)) {
AmbientSource.clip = RandomClip(AmbientClips);
AmbientSource.Play();
Refresh(AmbientSource, AmbientClips);
}
if (NeedsRefresh(IntenseAmbientSource)) {
IntenseAmbientSource.clip = RandomClip(IntenseAmbientClips);
IntenseAmbientSource.Play();
Refresh(IntenseAmbientSource, IntenseAmbientClips);
}
if (ActiveBurn > 0 && NeedsRefresh(ActiveBurnSource)) {
ActiveBurnSource.clip = RandomClip(CrackleClips);
ActiveBurnSource.Play();
Refresh(ActiveBurnSource, CrackleClips);
}
}
private void Refresh(AudioSource source, AudioClip[] clips) {
source.clip = RandomClip(clips);
if (source.clip != null) {
source.time = 0f;
source.Play();
}
}

View File

@ -1,6 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
using UnityEngine.SceneManagement;
[RequireComponent(typeof(CanvasGroup))]
public class GameOverMenu : MonoBehaviour {
@ -20,6 +19,18 @@ public class GameOverMenu : MonoBehaviour {
private void UpdateCanvas(bool instantTransition) {
bool IsGameOver = GameState.Current == State.GameOver;
Canvas.alpha = Mathf.Lerp(Canvas.alpha, IsGameOver ? 1 : 0, instantTransition ? 1 : 2f * Time.deltaTime);
Canvas.interactable = IsGameOver;
Canvas.blocksRaycasts = IsGameOver;
}
public void Resume() {
GameState.Current = State.Playing;
}
public void Replay() {
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
public void Exit() {
Application.Quit();
}
}

View File

@ -13,10 +13,15 @@ public class PauseMenu : MonoBehaviour {
private void Awake() {
Canvas = GetComponent<CanvasGroup>();
Canvas.alpha = Paused ? 1 : 0;
Fade(true);
}
private void Update() {
Canvas.alpha = Mathf.Lerp(Canvas.alpha, Paused ? 1 : 0, 10f * Time.unscaledDeltaTime);
Fade(false);
}
private void Fade(bool instant) {
Canvas.alpha = Mathf.Lerp(Canvas.alpha, Paused ? 1 : 0, instant ? 1 : 10f * Time.unscaledDeltaTime);
Canvas.blocksRaycasts = Paused;
}
}