Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a5c55b0

Browse files
committed
add airplane and fly script
1 parent c3702b5 commit a5c55b0

18 files changed

+1058
-68
lines changed

‎Assets/AircraftPropeller.prefab‎

Lines changed: 327 additions & 51 deletions
Large diffs are not rendered by default.

‎Assets/Fly.cs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
public class Fly : MonoBehaviour
6+
{
7+
public float rotationSpeed = 1.0f;
8+
public float speed = 1.0f;
9+
10+
void Update()
11+
{
12+
float translateX = Input.GetAxis("Horizontal") * speed;
13+
float translateY = Input.GetAxis("VerticalY") * speed;
14+
float translateZ = Input.GetAxis("Vertical") * speed;
15+
16+
transform.Translate(new Vector3(translateX, translateY, translateZ));
17+
}
18+
}

‎Assets/Fly.cs.meta‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /