Commit b9c99dce authored by Simon Hetzer's avatar Simon Hetzer
Browse files

spawnhight data removed, float value added

parent f384bfc8
%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: SpawnHight
m_EditorClassIdentifier:
value: 5
initValue: 0
fileFormatVersion: 2
guid: b41110fc745a592449a779c29c1378b5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -11,7 +11,7 @@ public class Score : MonoBehaviour
[SerializeField] private Transform playerLeft;
[SerializeField] private Transform playerRight;
[SerializeField] private IntValue spawnHight;
[SerializeField] private float spawnHight;
private void Start()
{
......@@ -26,12 +26,12 @@ public class Score : MonoBehaviour
if (other.transform.position.x < 0)
{
rightValue.value++;
other.transform.position = playerRight.position + new Vector3(0,5,0);
other.transform.position = playerRight.position + new Vector3(0,spawnHight,0);
}
else
{
leftValue.value++;
other.transform.position = playerLeft.position + new Vector3(0,5,0);
other.transform.position = playerLeft.position + new Vector3(0,spawnHight,0);
}
other.gameObject.GetComponent<Rigidbody2D>().velocity = Vector2.zero;
......
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