Initial Commit (broken due to version update)
This commit is contained in:
parent
74003df84b
commit
3f7b3b7440
3132 changed files with 1103305 additions and 0 deletions
25
Assets/Scripts/PaddleController.cs
Normal file
25
Assets/Scripts/PaddleController.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace Assets
|
||||
{
|
||||
public class PaddleController : MonoBehaviour
|
||||
{
|
||||
|
||||
public bool isPaddle1;
|
||||
public float speed = 5f;
|
||||
|
||||
void Start () {
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update ()
|
||||
{
|
||||
transform.position = new Vector3(transform.position.x,0,Input.GetAxis(isPaddle1?"Vertical":"Vertical2") * ScoreControl.Instance.ArenaWidth);
|
||||
if(isPaddle1)
|
||||
transform.Translate(0f, Input.GetAxis("Vertical")* speed * Time.deltaTime, 0f);
|
||||
else
|
||||
transform.Translate(0f, Input.GetAxis("Vertical2") * speed * Time.deltaTime, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue