10 2016 档案
摘要:using UnityEngine; using System.Collections; public enum BoxType { Normal,//普通格子 Equip//装备栏格子 } public enum EquipType { Weapon,//武器 Armor,//护甲 Shoot//鞋子 } public class Box...
阅读全文
摘要:using UnityEngine; using System.Collections; using UnityEngine.SceneManagement; public class ApplicationDemo : MonoBehaviour { void Start() { //支持后台运行 Application.runInBackg...
阅读全文
摘要:using UnityEngine; using System.Collections; using UnityEngine.EventSystems; //句柄 public class ButtonFuc : MonoBehaviour, IPointerEnterHandler,IPointerExitHandler,//进入,离开 IPointerDownHandler,IPointe...
阅读全文
摘要:以上脚本意思是 在Button按钮上挂载该脚本从而判断在用户名密码输入的是否为真确的。 接下获取事件系统组件然后确认输入框焦点
阅读全文
摘要:技能组件界面 ImageType是Filled类型 数值是1与脚本里面初始值一致,脚本控制其数字从1-0减小调整白色画布填充,达到有技能冷却效果。
阅读全文
摘要:有了坦克之后再创造敌军坦克,随机生成并且向主坦克进攻。没有创造发射子弹以及敌人消失功能
阅读全文
摘要:using UnityEngine; using System.Collections; public class PlayerTrigger : MonoBehaviour { void OnTriggerEnter(Collider other) { Debug.Log ("Enter"); }
阅读全文
摘要:using UnityEngine; using System.Collections; public class RayCastDemo : MonoBehaviour { //射线碰撞检测器 RaycastHit hit; void Update() { //通过鼠标屏幕坐标,生成一条射线对象 Ray r = Camer...
阅读全文
摘要:接物体的工具 创建掉落体的三个预设体
阅读全文
摘要:using UnityEngine; using System.Collections; public class CubeAddForce : MonoBehaviour { float hor,ver; //力的方向向量 Vector3 forceDir; //力的大小 public float
阅读全文
摘要:按键获取 WASD获取
阅读全文
摘要:using UnityEngine; using System.Collections; public class InitGameObject : MonoBehaviour { public GameObject bullet; void Update() { if (Input.GetKeyDown (KeyCode.Space)) { //通过预设体生成游戏对象(...
阅读全文
摘要:using UnityEngine; using System.Collections; public class CyCollision : MonoBehaviour { void OnCollisionEnter(Collision other) { // Debug.Log ("Enter"); // Debug.Log(other.col...
阅读全文
摘要:using UnityEngine; using System.Collections; public class CapsuleMove : MonoBehaviour { //方向 Vector3 dir; //上一帧的鼠标坐标 Vector3 begin; //当前帧的鼠标坐标 Vector3 end; public float speed = 3f; void O...
阅读全文

浙公网安备 33010602011771号