public Sprite[] tankSprite;
上右下左
public Sprite[] tankSprite;
上右下左
1.图集的切割
pubkic GameObject
Instantiate(explosionPrefab,transform.position,transform.rotation)
Instantiate(transform.position,Quaternion.identity
Destroy(gameObject,0.8f)
isPlayerBullect
Destroy(collision.gameObject
SpriteRenderer sr
sr=GetComponent
Sprite BrokenSprite
sr.sprite=BrokenSprite
transform.position,transform.rotaion
Destroy(gameObject, 0.2f);
explosionPrefab
private fooat defendTimeVal;
defendEffectPrefab
Bullect
public float moveSpeed = 10;
transform.Translate(transform.right*moveSpeed*Time.deltaTime,Space.World);
transform.Translate(transform.right*moveeSpeed*Time,deltaTime,Space.World);
private float timeVal;
OnTriggerEnter 2D(Collider2D collision)
private Vector3 bulllectEulerAngles;
Quaternion.Euler(transform.eulerAngles+bullectEulerAngles)
public GameObject bullecPrefab;
GetKeyDown(KeyCode.Space))
Instantiate(bullectPrefab,transform.position,transform.rotation);
FixedUpdate
fixedDeltaTime
Renderer
0 8 16 24
Scripts
public float moveSpeed = 3;
float h = Input.GetAxisRaw("Horizontal");
Vertical
public float moveSpeed = 3;
transform.Translate(Vector3.right*h*moveSpeed*Time.deltaTime,Space.World);
transform.Translate(Vector3.right*h*moveSpeed*Time.deltaTime,Space.World)
Prefabs
Wall
Barriar
Grass
Heart
Animation
Animator
Born
BronController
Effect
Explosion
Shield
River
学习发布的尺寸的大小与如何发bu
碰撞器的条件:要有刚体,一方是运动的(有时会休眠)
抖要放入fixupdat里
public class player : MonoBehaviour {
public float movespeed=3;
private SpriteRenderer sr;
public Sprite[] tankSprite;
private void Awake()
{
sr = GetComponent<SpriteRenderer>();
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float h = Input.GetAxisRaw("Horizontal");
transform.Translate(Vector3.right*h*movespeed*Time.deltaTime,Space.World );
if (h < 0){
sr.sprite = tankSprite[3];
}else if (h > 0)
{
sr.sprite = tankSprite[1];
}
float v = Input.GetAxisRaw("Vertical");
transform.Translate(Vector3.up*v*movespeed*Time.deltaTime ,Space.World);
if(v<0){
sr.sprite = tankSprite[2];
}else if (v > 0)
{
sr.sprite = tankSprite[0];
}
}
}
public float movespeed=3;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float h = Input.GetAxisRaw("Horizontal");
transform.Translate(Vector3.right*h*movespeed*Time.deltaTime,Space.World );
float v = Input.GetAxisRaw("Vertical");
transform.Translate(Vector3.up*v*movespeed*Time.deltaTime ,Space.World);
按住shift拖拽可以多选,可以制作动画
小图片的切割技术
这届是导入没有什么的主要内容