Add Mug Prefab + Vodka icon

This commit is contained in:
Antoine H 2021-01-13 14:59:50 +01:00
parent 901a2b6c10
commit 4289fae167
7 changed files with 537 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View file

@ -0,0 +1,106 @@
fileFormatVersion: 2
guid: 491626dac8ad56a4683d0b1776ac241b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 500
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

383
Assets/Prefabs/Mug.prefab Normal file
View file

@ -0,0 +1,383 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &886581776326592116
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 886581776326592119}
- component: {fileID: 886581776326592112}
- component: {fileID: 886581776326592113}
- component: {fileID: 886581776326592118}
m_Layer: 8
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &886581776326592119
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 886581776326592116}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.01, y: 0.01, z: 1}
m_Children:
- {fileID: 4918661187169251598}
m_Father: {fileID: 886581777645042261}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: -0.008, y: 0.0938}
m_SizeDelta: {x: 24.022388, y: 40.007996}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!223 &886581776326592112
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 886581776326592116}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: -1719862225
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!114 &886581776326592113
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 886581776326592116}
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
--- !u!114 &886581776326592118
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 886581776326592116}
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!1 &886581777645042264
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 886581777645042261}
- component: {fileID: 886581777645042266}
- component: {fileID: 886581777645042260}
- component: {fileID: 886581777645042267}
m_Layer: 8
m_Name: Mug
m_TagString: Grabable
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &886581777645042261
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 886581777645042264}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.59, y: 2.22, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 886581776326592119}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &886581777645042266
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 886581777645042264}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 5
m_Sprite: {fileID: 21300000, guid: 17d59b2d4d882c04480a40119a442279, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.25, y: 0.25}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!61 &886581777645042260
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 886581777645042264}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0.25, y: 0.25}
newSize: {x: 0.25, y: 0.25}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.25, y: 0.25}
m_EdgeRadius: 0
--- !u!114 &886581777645042267
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 886581777645042264}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 06f2e18c7d91f7f4d99cd5e5c7d12b45, type: 3}
m_Name:
m_EditorClassIdentifier:
dirty: 0
UIContent: {fileID: 4918661187169251599}
--- !u!1001 &886581776764977549
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 886581776326592119}
m_Modifications:
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_SizeDelta.x
value: -5.804775
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_SizeDelta.y
value: -20.589396
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 10.295
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5192471320214909068, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_Name
value: CircleTimer
objectReference: {fileID: 0}
- target: {fileID: 5192471320581481922, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -0.11000061
objectReference: {fileID: 0}
- target: {fileID: 5192471320581481922, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -0.059999466
objectReference: {fileID: 0}
- target: {fileID: 5192471320581481923, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7027467526786473816, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -0.38095284
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 887fdd182800875449ec5ddf381bcf87, type: 3}
--- !u!224 &4918661187169251598 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
m_PrefabInstance: {fileID: 886581776764977549}
m_PrefabAsset: {fileID: 0}
--- !u!114 &4918661187169251599 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5192471320214909058, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
m_PrefabInstance: {fileID: 886581776764977549}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: da748f5c6c44f274786e0947a0c6bbf8, type: 3}
m_Name:
m_EditorClassIdentifier:

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 48d421824701a084db0b64ed8eb13372
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -36,8 +36,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: -0.0025, y: 0.5007}
m_SizeDelta: {x: 50.83068, y: 92.88135}
m_AnchoredPosition: {x: -0.0025, y: 0.56}
m_SizeDelta: {x: 50.83068, y: 104.67413}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!223 &3180865248817503816
Canvas:
@ -127,7 +127,7 @@ Transform:
m_GameObject: {fileID: 3180865249454882891}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.74, y: 1.67, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 0.94767773, y: 0.69710344, z: 1}
m_Children:
- {fileID: 3180865248817503821}
m_Father: {fileID: 0}
@ -232,6 +232,12 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 3180865248817503821}
m_Modifications:
- target: {fileID: 1800030824761736103, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: -1209127185579228243, guid: bfabe3920bf35724b9a95bf95f5431a9,
type: 3}
- target: {fileID: 5192471320214909059, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_Pivot.x
@ -352,10 +358,25 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: -0.05999756
objectReference: {fileID: 0}
- target: {fileID: 7027467526786473816, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_SizeDelta.x
value: -13.85503
objectReference: {fileID: 0}
- target: {fileID: 7027467526786473816, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_SizeDelta.y
value: -17.113615
objectReference: {fileID: 0}
- target: {fileID: 7027467526786473816, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -0.38095284
value: -0.20000076
objectReference: {fileID: 0}
- target: {fileID: 7027467526786473816, guid: 887fdd182800875449ec5ddf381bcf87,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 887fdd182800875449ec5ddf381bcf87, type: 3}

View file

@ -70,7 +70,7 @@ public class Cleaning_workshop : Workshop
if(UIPrepTimer != null) //Display UI prep timer
{
UIPrepTimer.SetValue(prepTimer/prepTime);
UIPrepTimer.DisplayIcon(false);
// UIPrepTimer.DisplayIcon(false);
UIPrepTimer.gameObject.SetActive(true);
}
}

View file

@ -11,6 +11,8 @@ public class Mug : MonoBehaviour, IGrabable
public bool dirty = false;
public Consumable content{get; protected set;} = null; //new Consumable("beer",1,null);
public UITimer UIContent = null;
//TODO: Gérer objets tavernier (drop) et autres
public bool use(GameObject userObject)
{
@ -37,17 +39,23 @@ public class Mug : MonoBehaviour, IGrabable
if(content is null)
{
content = new_content;
if(UIContent!=null)
UIContent.DisplayIcon(content.Sprite);
UIContent.gameObject.SetActive(true);
}
else
{
Debug.Log(gameObject.name+" cannot be filled (already full) with "+new_content.Type);
}
}
public Consumable consume() //Return Mug content and empty it
{
Consumable output = content;
content=null;
dirty = true; //Used and dirty
//Turn off UI display
if(UIContent!=null)
UIContent.gameObject.SetActive(false);
return output;
}
@ -58,6 +66,11 @@ public class Mug : MonoBehaviour, IGrabable
Debug.LogWarning(gameObject.name+" layer should be set to 'Interactions' to work properly");
if(gameObject.tag != "Grabable")
Debug.LogWarning(gameObject.name+" tag should be set to 'Grabable' to work properly");
if(UIContent is null)
Debug.LogWarning(gameObject.name+" doesn't have a UIContent set");
else
UIContent.gameObject.SetActive(false);
}
// Update is called once per frame