目录
🎈课程介绍
Unity,一款游戏引擎,主要用于开发3D游戏,如下图所示:
常见的游戏引擎:
- Unity(C#)
- Unreal Engine(C++)
- Cocos Creator(JavaScript)
- Frostbite Engine、Source Engine、Cry Engine…
🎈游戏开发 VS 游戏建模
游戏开发,面向开发人员
游戏建模,面向美术人员,如下图所示:
CG建模软件:3Dmax、Maya、Blender、Cinema4D、ZBrushi…
🎈基础要求
本课程为零基础课程,不要求先学会其他的3D软件
Unity使用C#代码来实现游戏逻辑:
- 会C#/Java,直接学习,以下是一段C#代码,相信Java程序猿也没有压力
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerLogic : MonoBehaviour
{
[Tooltip("子弹节点的预制体")]
public GameObject bulletPrefab;
[Tooltip("子弹节点的父节点")]
public Transform bulletFolder;
[Tooltip("子弹出生点")]
public Transform firePoint;
[Tooltip("开火间隔")]
public float fireInterval = 0.1f;
[Tooltip("平移速度")]
public float moveSpeed = 0.1f;
// Start is called before the first frame update
void Start()
{
InvokeRepeating("fire", fireInterval, fireInterval);
}
// Update is called once per frame
void Update()
{
float dx = 0;
if (Input.GetKey(KeyCode.A))
{
dx = -moveSpeed;
}
if (Input.GetKey(KeyCode.D))
{
dx = moveSpeed;
}
this.transform.Translate(dx, 0, 0, Space.self);
}
private void Fire()
{
//实例化一个子弹节点
GameObject node = Instantiate(bulletPrefab, bulletFolder);
//把子弹移动到出生点位置
node.transform.position = firePoint.position;
}
}
- 不会编程, 建议先学Java
- 不想学编程, 建议学习Blender建模