![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Unity入门
unity的入门学习
pancakeface
这个作者很懒,什么都没留下…
展开
-
Unity2D入门6 下蹲
完整代码 bool checkHit() { Vector2 origin1, origin2; bool standUps = true; origin1 = transform.position + new Vector3(-0.25f, -0.25f); origin2 = transform.position ...原创 2020-03-15 05:11:50 · 955 阅读 · 1 评论 -
Unity2D入门5 爬梯子
完整代码 public float climbspeed = 2f; private bool inLadder; public Collider2D platf; private void OnTriggerStay2D(Collider2D collision) { if (collision.tag == "Player") ...原创 2020-03-14 02:16:38 · 3942 阅读 · 0 评论 -
Unity2D入门4 简单物品收集
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Collection") { Destroy(collision.gameObject); } }原创 2020-03-14 02:10:27 · 600 阅读 · 0 评论 -
Unity2D入门3 简单镜头移动
简单镜头移动public Transform player; void Update() { transform.position = new Vector3(player.position.x, player.position.y, -10f); }给main camera添加new script与player连接。...原创 2020-03-10 17:39:11 · 525 阅读 · 0 评论 -
Unity2D入门2 public和private
private Rigidbody2D rb; private Animator Anim; void Start() { rb = GetComponent<Rigidbody2D>(); Anim = GetComponent<Animator>(); }私有在unity界面不显示,通...原创 2020-03-10 01:16:00 · 487 阅读 · 0 评论 -
Unity2D入门1 简单角色移动与动画 基础
初级角色移动完整代码using System.Collections;using System.Collections.Generic;using UnityEngine;public class PlayerControl : MonoBehaviour{ public Rigidbody2D rb; public Animator Anim; public ...原创 2020-03-02 18:24:46 · 1566 阅读 · 0 评论