fixed stupid wraparound issue
This commit is contained in:
parent
99e949cd9b
commit
60f39951a5
|
@ -15,6 +15,7 @@ GameObject:
|
|||
- component: {fileID: 2766037370157449026}
|
||||
- component: {fileID: 2122656558574222561}
|
||||
- component: {fileID: -3971665732303992234}
|
||||
- component: {fileID: -4901459127090716512}
|
||||
m_Layer: 7
|
||||
m_Name: Enemy
|
||||
m_TagString: Untagged
|
||||
|
@ -136,3 +137,17 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
value: 1000
|
||||
--- !u!114 &-4901459127090716512
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1738226812227614583}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 990644fedd5c4b99befe1da660313b53, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
xMin: -10.1
|
||||
xMax: 10.1
|
||||
|
|
|
@ -275,8 +275,8 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
spawnOnBeat: 1
|
||||
xMin: -5
|
||||
xMax: 5
|
||||
xMin: -10
|
||||
xMax: 10
|
||||
--- !u!114 &531937975 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 5076175860835241000, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Weapons.Scripts;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public class AddScoreOnDie : MonoBehaviour
|
||||
{
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class WrapAroundOnEnable : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private float xMin, xMax;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
WaitUtils.Wait(Time.deltaTime, true, () =>
|
||||
{
|
||||
|
||||
var w = Mathf.Abs(xMax - xMin);
|
||||
var x = transform.localPosition.x;
|
||||
if (x > xMax)
|
||||
{
|
||||
x -= w;
|
||||
}
|
||||
else if (x < xMin)
|
||||
{
|
||||
x += w;
|
||||
}
|
||||
transform.localPosition = new Vector3(
|
||||
x,
|
||||
transform.localPosition.y,
|
||||
transform.localPosition.z);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 990644fedd5c4b99befe1da660313b53
|
||||
timeCreated: 1610299723
|
|
@ -113,12 +113,12 @@ MonoBehaviour:
|
|||
spawnPlane: 1
|
||||
width: 0
|
||||
height: 0
|
||||
surfaceOnly: 1
|
||||
surfaceOnly: 0
|
||||
evenDistribution: 0
|
||||
numSides: 3
|
||||
numPerSide: 10
|
||||
flipVertical: 0
|
||||
radius: 5
|
||||
radius: 10
|
||||
arc: 360
|
||||
composite: []
|
||||
manualFire: 1
|
||||
|
|
Loading…
Reference in New Issue