You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
551 B
C#
24 lines
551 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[RequireComponent(typeof(MoveController))]
|
|
public class PlayerController : MonoBehaviour {
|
|
public MoveController moveController;
|
|
|
|
private float gravity = -20;
|
|
private Vector3 velocity;
|
|
|
|
void Start() {
|
|
moveController = GetComponent<MoveController>();
|
|
}
|
|
|
|
void Update() {
|
|
velocity.y += gravity * Time.deltaTime;
|
|
moveController.Move(velocity * Time.deltaTime);
|
|
}
|
|
|
|
void FixedUpdate() {
|
|
}
|
|
}
|