- 博客(7)
- 收藏
- 关注
原创 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
1003
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
4162
原创 Unity2D入门4 简单物品收集
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Collection") { Destroy(collision.gameObject); } }
2020-03-14 02:10:27
638
原创 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
605
原创 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
523
原创 c#入门笔记1,2020.3.4
数据类型整形int 32bitlong 64bit浮点型float 32bitdouble 64bitdecimal 128bit字符串char ’ ’string " "转义字符\n 换行\t tab\ 斜杠" 双引号@" " 使句中转义符失效字面值整形为int,浮点型为double隐式类型varvar sb = 1;sb会自适应为int型;...
2020-03-04 17:53:29
186
原创 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
1614
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人