ball testing
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class MoverSettingsManager : MonoBehaviour
|
||||
{
|
||||
public Slider xSlider,ySlider;
|
||||
public Button btnClose,btnSave,btnRestart;
|
||||
public Button btnClose,btnBackToPrep,btnRestart;
|
||||
public PredictiveMover mover;
|
||||
|
||||
public GameObject panel;
|
||||
@@ -14,11 +14,10 @@ public class MoverSettingsManager : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
xSlider.onValueChanged.AddListener(OnSettingsChanged);
|
||||
ySlider.onValueChanged.AddListener(OnSettingsChanged);
|
||||
|
||||
btnClose.onClick.AddListener(HideSettings);
|
||||
btnRestart.onClick.AddListener(Restart);
|
||||
btnBackToPrep.onClick.AddListener(()=>{SceneManager.LoadScene("prep");});
|
||||
m_onSettingsChanged();
|
||||
}
|
||||
|
||||
@@ -32,9 +31,6 @@ public class MoverSettingsManager : MonoBehaviour
|
||||
}
|
||||
|
||||
void m_onSettingsChanged(){
|
||||
mover.multipliers.x = xSlider.value;
|
||||
mover.multipliers.y = ySlider.value;
|
||||
|
||||
mover.RegenerateLines();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using UnityEngine.EventSystems;
|
||||
public class MoverSettingsPanel : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
|
||||
{
|
||||
|
||||
float touchdownTimer =0f;
|
||||
public float touchdownTimer =0f;
|
||||
public void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
touchdownTimer =0f;
|
||||
@@ -14,7 +14,7 @@ public class MoverSettingsPanel : MonoBehaviour, IPointerDownHandler, IPointerUp
|
||||
|
||||
public void OnPointerUp(PointerEventData eventData)
|
||||
{
|
||||
if(touchdownTimer > 4){
|
||||
if(touchdownTimer > 2){
|
||||
settingsPanel.SetActive(true);
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class MoverSettingsPanel : MonoBehaviour, IPointerDownHandler, IPointerUp
|
||||
|
||||
void Update()
|
||||
{
|
||||
if(touchdownTimer < 5f){
|
||||
if(touchdownTimer < 3f){
|
||||
touchdownTimer +=Time.deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,17 +38,20 @@ public class PredictiveMover : MonoBehaviour
|
||||
Restart();
|
||||
}
|
||||
|
||||
|
||||
float playbackTime;
|
||||
void FixedUpdate(){
|
||||
// RegenerateLines();
|
||||
objectToMove.transform.position = Vector3.Lerp(objectToMove.transform.position,GetPositionAtTime(source.time + audioOffset),0.5f);
|
||||
CamFollower.instance.UpdateFrame();
|
||||
source.time = playbackTime;
|
||||
playbackTime+=Time.deltaTime;
|
||||
}
|
||||
|
||||
public void Restart(){
|
||||
source.time =0;
|
||||
playbackTime=0;
|
||||
source.Play();
|
||||
|
||||
|
||||
RegenerateLines();
|
||||
List<Vector3> botPoints = new List<Vector3>();
|
||||
List<Vector3> topPoints = new List<Vector3>();
|
||||
|
||||
19
Assets/Scripts/Mover/SaveLoadMover.cs
Normal file
19
Assets/Scripts/Mover/SaveLoadMover.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SaveLoadMover : MonoBehaviour
|
||||
{
|
||||
public Mover mover;
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Mover/SaveLoadMover.cs.meta
Normal file
11
Assets/Scripts/Mover/SaveLoadMover.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2b99dc11aa746e4cabb4b9fad122746
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user