Make Vending Machine graphics

This commit is contained in:
Sofia 2019-08-14 21:00:55 +03:00
parent 6a96b94a2b
commit ce68587d3c
26 changed files with 323 additions and 9 deletions

View File

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

View File

Before

Width:  |  Height:  |  Size: 883 B

After

Width:  |  Height:  |  Size: 883 B

View File

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,259 @@
fileFormatVersion: 2
guid: 0aa113ac73f3394448b77e6c4c712232
TextureImporter:
internalIDToNameTable:
- first:
213: 8265045834036228682
second: VendingMachine_0
- first:
213: -7095097463981226713
second: VendingMachine_1
- first:
213: -5872275606889041824
second: VendingMachine_2
- first:
213: 6754790859930108749
second: VendingMachine_3
- first:
213: 881297774068237510
second: VendingMachine_4
- first:
213: 2570391356933361261
second: VendingMachine_5
externalObjects: {}
serializedVersion: 10
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 32
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
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
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: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: VendingMachine_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 32
height: 64
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: b1139409899aa5546b2d81a56fe5da62
internalID: 8265045834036228682
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: VendingMachine_1
rect:
serializedVersion: 2
x: 32
y: 0
width: 32
height: 64
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 404763ca50085ad4fa1ee0c3b6187eb0
internalID: -7095097463981226713
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: VendingMachine_2
rect:
serializedVersion: 2
x: 64
y: 0
width: 32
height: 64
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 81901f7e54bf4874d8c2f971ff55884d
internalID: -5872275606889041824
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: VendingMachine_3
rect:
serializedVersion: 2
x: 96
y: 0
width: 32
height: 64
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: b5fbf5de5b451324e93170572c5ace83
internalID: 6754790859930108749
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: VendingMachine_4
rect:
serializedVersion: 2
x: 128
y: 0
width: 32
height: 64
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 21b3f1c752ff88648b5cfc2964eecfde
internalID: 881297774068237510
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: VendingMachine_5
rect:
serializedVersion: 2
x: 160
y: 0
width: 32
height: 64
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: c81afef4386e70940a8a7ed6d794f43c
internalID: 2570391356933361261
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID: 6a6b28d52a426d84a848dacb0b72a50e
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -10,6 +10,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 11699643643052995} - component: {fileID: 11699643643052995}
- component: {fileID: 11699643643052996} - component: {fileID: 11699643643052996}
- component: {fileID: 7530413041674808940}
m_Layer: 0 m_Layer: 0
m_Name: Placeholder m_Name: Placeholder
m_TagString: Untagged m_TagString: Untagged
@ -26,7 +27,7 @@ Transform:
m_GameObject: {fileID: 11699643643052994} m_GameObject: {fileID: 11699643643052994}
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_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 3, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 11699643827672082} m_Father: {fileID: 11699643827672082}
m_RootOrder: 0 m_RootOrder: 0
@ -69,7 +70,8 @@ SpriteRenderer:
m_SortingLayerID: 106348079 m_SortingLayerID: 106348079
m_SortingLayer: 3 m_SortingLayer: 3
m_SortingOrder: 0 m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 472874229c563e241bddc073ec2dbb90, type: 3} m_Sprite: {fileID: 8265045834036228682, guid: 0aa113ac73f3394448b77e6c4c712232,
type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0
m_FlipY: 0 m_FlipY: 0
@ -80,6 +82,25 @@ SpriteRenderer:
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 0 m_MaskInteraction: 0
m_SpriteSortPoint: 0 m_SpriteSortPoint: 0
--- !u!95 &7530413041674808940
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 11699643643052994}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: e29dc16ffb250b742820ca64a9b6886f, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1 &11699643827672081 --- !u!1 &11699643827672081
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -128,11 +149,19 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a80c0c53597a834e9decbeebcb08434, type: 3} m_Script: {fileID: 11500000, guid: 7a80c0c53597a834e9decbeebcb08434, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
GunLaunchForceMultiplier: 3.5
HoleTransform: {fileID: 11699643844798483}
GunsLeft: 3 GunsLeft: 3
PossibleGuns: PossibleGuns:
- {fileID: 4462327694118370270, guid: 7b3529c1a7d22d143a060281857bbca5, type: 3} - {fileID: 4462327694118370270, guid: 7b3529c1a7d22d143a060281857bbca5, type: 3}
GunLaunchForceMultiplier: 3.5 Sprite: {fileID: 11699643643052996}
HoleTransform: {fileID: 11699643844798483} Sprites:
- {fileID: 2570391356933361261, guid: 0aa113ac73f3394448b77e6c4c712232, type: 3}
- {fileID: 881297774068237510, guid: 0aa113ac73f3394448b77e6c4c712232, type: 3}
- {fileID: 6754790859930108749, guid: 0aa113ac73f3394448b77e6c4c712232, type: 3}
- {fileID: -5872275606889041824, guid: 0aa113ac73f3394448b77e6c4c712232, type: 3}
- {fileID: -7095097463981226713, guid: 0aa113ac73f3394448b77e6c4c712232, type: 3}
- {fileID: 8265045834036228682, guid: 0aa113ac73f3394448b77e6c4c712232, type: 3}
DebugExpelGun: 0 DebugExpelGun: 0
--- !u!50 &11699643827672084 --- !u!50 &11699643827672084
Rigidbody2D: Rigidbody2D:
@ -168,7 +197,7 @@ BoxCollider2D:
m_IsTrigger: 0 m_IsTrigger: 0
m_UsedByEffector: 0 m_UsedByEffector: 0
m_UsedByComposite: 0 m_UsedByComposite: 0
m_Offset: {x: 0, y: 0} m_Offset: {x: 0.014128566, y: -0.004709959}
m_SpriteTilingProperty: m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0} pivot: {x: 0, y: 0}
@ -179,7 +208,7 @@ BoxCollider2D:
adaptiveTiling: 0 adaptiveTiling: 0
m_AutoTiling: 0 m_AutoTiling: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 1, y: 1.4901962} m_Size: {x: 0.8587153, y: 1.7821851}
m_EdgeRadius: 0 m_EdgeRadius: 0
--- !u!114 &11699643827672086 --- !u!114 &11699643827672086
MonoBehaviour: MonoBehaviour:

View File

@ -109387,6 +109387,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 11699643643052994, guid: 254d8b252b63a6547810dd3729ddc91b,
type: 3}
propertyPath: m_Name
value: Graphic
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 254d8b252b63a6547810dd3729ddc91b, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 254d8b252b63a6547810dd3729ddc91b, type: 3}
--- !u!1001 &592487111117925280 --- !u!1001 &592487111117925280

View File

@ -1,21 +1,33 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.Animations;
using Saltosion.OneWeapon.Guns; using Saltosion.OneWeapon.Guns;
using Saltosion.OneWeapon.Utils; using Saltosion.OneWeapon.Utils;
namespace Saltosion.OneWeapon.Environment { namespace Saltosion.OneWeapon.Environment {
public class VendingMachine : MonoBehaviour { public class VendingMachine : MonoBehaviour {
[Header("General")]
public float GunLaunchForceMultiplier = 1;
public Transform HoleTransform;
[Header("Gunstuff")]
public int GunsLeft = 3; public int GunsLeft = 3;
public List<GameObject> PossibleGuns = new List<GameObject>(); public List<GameObject> PossibleGuns = new List<GameObject>();
public float GunLaunchForceMultiplier = 1; [Header("Graphics")]
public SpriteRenderer Sprite;
public Transform HoleTransform; public List<Sprite> Sprites = new List<Sprite>();
[Header("Debug")]
public bool DebugExpelGun = false; public bool DebugExpelGun = false;
void Start() {
GunsLeft = Mathf.Clamp(GunsLeft, 0, 5);
Sprite.sprite = Sprites[GunsLeft];
}
void Update() { void Update() {
if (DebugExpelGun) { if (DebugExpelGun) {
ExpelGun(); ExpelGun();
@ -35,6 +47,7 @@ namespace Saltosion.OneWeapon.Environment {
Body.AddForce(DownwardForce + SidewaysForce, ForceMode2D.Impulse); Body.AddForce(DownwardForce + SidewaysForce, ForceMode2D.Impulse);
} }
GunsLeft -= 1; GunsLeft -= 1;
Sprite.sprite = Sprites[GunsLeft];
if (GunsLeft == 0) { if (GunsLeft == 0) {
Destroy(this); Destroy(this);
} }

Binary file not shown.