- 教程
- Space Shooter tutorial
- Creating shots
Creating shots
版本检查: 5.1
-
难度: 新手
Creating shots by assembling artwork, physics components and custom C# code.


Creating shots
新手 Space Shooter tutorial
Please note that this project was developed for Unity version 4. It currently works, and has been checked, with Unity version 5.1. Please turn annotations on while watching the video, as we can add annotations to the videos when there are discrepancies between the recorded content and the current version of Unity.
Get the Upgrade Guide for Unity 5 here.
Please refer to the Official Q&A Page on the Forums for an Upgrade FAQ and to ask any questions.
Mover
Code snippet
using UnityEngine;
using System.Collections;
public class Mover : MonoBehaviour
{
public float speed;
void Start ()
{
rigidbody.velocity = transform.forward * speed;
}
}
var speed : float;
function Start () : void {
rigidbody.velocity = transform.forward * speed;
}
import UnityEngine
import System.Collections
public class Mover(MonoBehaviour):
public speed as single
private def Start():
rigidbody.velocity = (transform.forward * speed)
相关教程
- Materials (课程)
- Textures (课程)
- Colliders (课程)
- Colliders as Triggers (课程)
- Rigidbodies (课程)
相关文档
- Materials and Shaders (手册)
- Materials (手册)
- Built-in Shader Guide (手册)
- Shader Reference (Advanced) (手册)
- Rigidbody (手册)
- Capsule Collider (手册)