Browse Source

Save menu button

master
Christopher 8 years ago
parent
commit
923a054a26
  1. 43
      Assets/Fungus/Scripts/Components/SaveGameHelper.cs
  2. BIN
      Assets/Fungus/Textures/settings.png
  3. 59
      Assets/Fungus/Textures/settings.png.meta
  4. BIN
      Assets/Fungus/Textures/settings.psd
  5. 59
      Assets/Fungus/Textures/settings.psd.meta
  6. 1890
      Assets/FungusExamples/SaveGame/SaveExample.unity

43
Assets/Fungus/Scripts/Components/SaveGameHelper.cs

@ -18,6 +18,10 @@ namespace Fungus
[SerializeField] protected bool restartDeletesSave = false; [SerializeField] protected bool restartDeletesSave = false;
[SerializeField] protected CanvasGroup saveMenuGroup;
[SerializeField] protected Button saveMenuButton;
[SerializeField] protected Button saveButton; [SerializeField] protected Button saveButton;
[SerializeField] protected Button loadButton; [SerializeField] protected Button loadButton;
@ -66,6 +70,8 @@ namespace Fungus
{ {
rewindButton.interactable = saveManager.NumSavePoints > 1; rewindButton.interactable = saveManager.NumSavePoints > 1;
} }
Debug.Log("Update");
} }
protected void CheckSavePointKeys() protected void CheckSavePointKeys()
@ -90,7 +96,6 @@ namespace Fungus
keys.Add(savePoint.SavePointKey); keys.Add(savePoint.SavePointKey);
} }
} }
} }
protected void PlayClickSound() protected void PlayClickSound()
@ -101,10 +106,46 @@ namespace Fungus
} }
} }
protected LTDescr fadeTween;
protected bool saveMenuActive = true;
#region Public methods #region Public methods
public SaveGameObjects SaveGameObjects { get { return saveGameObjects; } } public SaveGameObjects SaveGameObjects { get { return saveGameObjects; } }
public virtual void ToggleSaveMenu()
{
if (fadeTween != null)
{
LeanTween.cancel(fadeTween.id);
fadeTween = null;
}
if (saveMenuActive)
{
// Switch save menu off
LeanTween.value(saveMenuGroup.gameObject, saveMenuGroup.alpha, 0f, 0.5f).setOnUpdate( (t) => {
saveMenuGroup.alpha = t;
}).setOnComplete( () => {
//saveMenuGroup.interactable = false;
//saveMenuGroup.gameObject.SetActive(false);
});
}
else
{
// Switch save menu on
//saveMenuGroup.gameObject.SetActive(true);
saveMenuGroup.interactable = false;
LeanTween.value(saveMenuGroup.gameObject, saveMenuGroup.alpha, 1f, 0.5f).setOnUpdate( (t) => {
saveMenuGroup.alpha = t;
}).setOnComplete( () => {
});
}
saveMenuActive = !saveMenuActive;
}
public virtual void Save() public virtual void Save()
{ {
var saveManager = FungusManager.Instance.SaveManager; var saveManager = FungusManager.Instance.SaveManager;

BIN
Assets/Fungus/Textures/settings.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

59
Assets/Fungus/Textures/settings.png.meta

@ -0,0 +1,59 @@
fileFormatVersion: 2
guid: 8d3c80dd0c2904cdbb745cf481348a76
timeCreated: 1480950906
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 16
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Fungus/Textures/settings.psd

Binary file not shown.

59
Assets/Fungus/Textures/settings.psd.meta

@ -0,0 +1,59 @@
fileFormatVersion: 2
guid: d06e09af315a64fc286ee567fe2a4ea5
timeCreated: 1480952061
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

1890
Assets/FungusExamples/SaveGame/SaveExample.unity

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save