Commit 2a1d3067 authored by Manuel Buß's avatar Manuel Buß
Browse files

Solution A7

parent e8b17ab4
fileFormatVersion: 2
guid: 4ddfad75e3651f04693a355a6bef2c85
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 92e1008df43e3cc4295e764d804d086a, type: 3}
m_Name: ScoreLeft
m_EditorClassIdentifier:
value: 0
initValue: 0
fileFormatVersion: 2
guid: 8ed4346dcc65e864eb5b98bf1f2c6ab0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 92e1008df43e3cc4295e764d804d086a, type: 3}
m_Name: ScoreRight
m_EditorClassIdentifier:
value: 0
initValue: 0
fileFormatVersion: 2
guid: ca7d6e204890b03408316f4ddf5ad5ef
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -15,7 +15,7 @@ GameObject:
- component: {fileID: 3930011882176210989}
m_Layer: 11
m_Name: Ball
m_TagString: Untagged
m_TagString: Ball
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
......
......@@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 4654176504226165808}
- component: {fileID: 7229972793953828785}
- component: {fileID: 100799371145877907}
- component: {fileID: 4702233790945130546}
m_Layer: 8
m_Name: Ground
m_TagString: Untagged
......@@ -104,5 +105,21 @@ BoxCollider2D:
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_Size: {x: 20, y: 1}
m_EdgeRadius: 0
--- !u!114 &4702233790945130546
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4702233790945130544}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c22e8e5953e411946aaf721124fa7764, type: 3}
m_Name:
m_EditorClassIdentifier:
leftValue: {fileID: 11400000, guid: 8ed4346dcc65e864eb5b98bf1f2c6ab0, type: 2}
rightValue: {fileID: 11400000, guid: ca7d6e204890b03408316f4ddf5ad5ef, type: 2}
spawnLeft: {x: -6, y: 1}
spawnRight: {x: 6, y: 1}
......@@ -567,11 +567,6 @@ PrefabInstance:
propertyPath: m_Name
value: Ball
objectReference: {fileID: 0}
- target: {fileID: 1497791176711212348, guid: bbefa251abdacad45a00e0adadcf83ef,
type: 3}
propertyPath: m_TagString
value: Ball
objectReference: {fileID: 0}
- target: {fileID: 5327317936299510030, guid: bbefa251abdacad45a00e0adadcf83ef,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -771,35 +766,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 100799371145877907, guid: a1da377d3a985bc4b95e3d994a387f4e,
type: 3}
propertyPath: m_Size.x
value: 20
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a1da377d3a985bc4b95e3d994a387f4e, type: 3}
--- !u!1 &4702233790945130544 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4702233790945130544, guid: a1da377d3a985bc4b95e3d994a387f4e,
type: 3}
m_PrefabInstance: {fileID: 3578180947197286935}
m_PrefabAsset: {fileID: 0}
--- !u!114 &4702233790945130546
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4702233790945130544}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c22e8e5953e411946aaf721124fa7764, type: 3}
m_Name:
m_EditorClassIdentifier:
leftValue: 0
rightValue: 0
spawnLeft: {x: -6, y: 1}
spawnRight: {x: 6, y: 1}
--- !u!1001 &5646315729808804356
PrefabInstance:
m_ObjectHideFlags: 0
......
fileFormatVersion: 2
guid: f030a736a5318224690be5b776f1f977
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
[CreateAssetMenu(menuName = "IntValue")]
public class IntValue : ScriptableObject
{
public int value;
public int initValue;
}
fileFormatVersion: 2
guid: 92e1008df43e3cc4295e764d804d086a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0e8438f2777d8aa43a885ebb31c5bbc7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -2,16 +2,16 @@
public class Score : MonoBehaviour
{
[SerializeField]private int leftValue;
[SerializeField]private int rightValue;
[SerializeField]private IntValue leftValue;
[SerializeField]private IntValue rightValue;
[SerializeField]private Vector2 spawnLeft;
[SerializeField]private Vector2 spawnRight;
private void Start()
{
leftValue = 0;
rightValue = 0;
leftValue.value = leftValue.initValue;
rightValue.value = rightValue.initValue;
}
private void OnCollisionEnter2D(Collision2D other)
......@@ -20,12 +20,12 @@ public class Score : MonoBehaviour
if (other.transform.position.x < 0)
{
rightValue++;
rightValue.value++;
other.transform.position = spawnRight;
}
else
{
leftValue++;
leftValue.value++;
other.transform.position = spawnLeft;
}
......
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