Commit 45de0e24 authored by Sebastian Frey's avatar Sebastian Frey
Browse files

fixed Layer-Abfrage bei Kollision zwischen Spieler und Element

parent ffd2f3a6
fileFormatVersion: 2
guid: f2065fb3797f1427aa8b3fc04af35e35
timeCreated: 1508958111
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
fileIDToRecycleName:
2186277476908879412: ImportLogs
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
......@@ -12,6 +12,8 @@ TextureImporter:
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
......@@ -20,6 +22,8 @@ TextureImporter:
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
......@@ -27,10 +31,13 @@ TextureImporter:
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -1
wrapMode: 1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
......@@ -39,46 +46,66 @@ TextureImporter:
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
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:
- buildTarget: DefaultTexturePlatform
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: WebGL
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 336a38d957ba588489ecf85d686fd9e5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -10,9 +10,9 @@ GameObject:
m_Component:
- component: {fileID: 5837352869851492550}
- component: {fileID: 2960050771917211750}
- component: {fileID: 7732216525054800400}
- component: {fileID: 2818411747050238735}
m_Layer: 10
- component: {fileID: 5686844106502763949}
m_Layer: 11
m_Name: Element
m_TagString: Element
m_Icon: {fileID: 0}
......@@ -81,22 +81,6 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!70 &7732216525054800400
CapsuleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1696247561678524538}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_Size: {x: 0.2, y: 0.2}
m_Direction: 0
--- !u!114 &2818411747050238735
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -109,3 +93,29 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c97c8a65070f2bd4b9aabdf4108c3bb9, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!61 &5686844106502763949
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1696247561678524538}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
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: 1, y: 1}
newSize: {x: 0.2, y: 0.2}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
......@@ -4,9 +4,10 @@ namespace _Game.Scripts.Elements
{
public class InteractionObject : MonoBehaviour
{
public void DoInteraction()
public void InfuseElement()
{
this.GetComponent<SpriteRenderer>().color = Color.green;
Debug.Log("Infused " + this.gameObject.tag);
}
}
}
fileFormatVersion: 2
guid: 5782222d4c9b9424ea96676650e643a8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -43,12 +43,13 @@ namespace _Game.Scripts.Player
state.currentElement = InfusedElement.None;
break;
}
_targetScript.InfuseElement();
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.layer != 10) return;
if (other.gameObject.layer != LayerMask.NameToLayer("Elements")) return;
Debug.Log("Entered Collider of " + other.name);
_currentObject = other.gameObject;
......@@ -57,7 +58,7 @@ namespace _Game.Scripts.Player
private void OnTriggerExit2D(Collider2D other)
{
if (other.gameObject.layer != 10) return;
if (other.gameObject.layer != LayerMask.NameToLayer("Elements")) return;
if (other.gameObject != _currentObject) return;
Debug.Log("Exited Collider of " + other.name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment