- 博客(41)
- 收藏
- 关注
转载 Antialiasing 抗锯齿效果(render to texture锯齿问题处理)
很多时候需要把相机得texture渲染到texture上。但是效果往往不理想。如图对比: 没有处理过得效果 处理过得效果 ...
2018-11-02 11:06:00 554
转载 unity引擎面板管理相关方法
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.Serialization; [AddComponentMenu("Sample/TestCode")] //Component上会增加一个Sample/TestCode选项 ...
2018-10-23 11:45:00 135
转载 json数据解析转文本方法
需要用到LitJSON.dllJsonMapperusing LitJson;using System; public class Person{ // C# 3.0 auto-implemented properties public string Name { get; set; } p...
2018-10-19 11:55:00 560
转载 百度HttpV3版本图片识别
using System;using System.Collections;using System.IO;using Baidu.Aip.Face;using Newtonsoft.Json.Linq;using UnityEngine;using UnityEngine.UI;public class WebCameraManager : Mono...
2018-10-19 11:38:00 444
转载 项目用Socket网络框架+Protobuf
https://pan.baidu.com/s/1w2vZbWWCooq2drCloYiMng转载于:https://www.cnblogs.com/VR-1024/p/9815531.html
2018-10-19 11:35:00 133
转载 各类数据类型的转换类
using System;using System.Collections;using System.Collections.Generic;using UnityEngine;/// <summary>/// string扩展方法/// </summary>public static class KTOString {...
2018-10-19 11:29:00 173
转载 异形按钮点击触发
using UnityEngine;using UnityEngine.UI;public class IrregularButton : MonoBehaviour { void Awake () { // 设置阈值 Image image = GetComponent<Image>(); i...
2018-10-19 11:26:00 171
转载 通过名字找物体工具
简单直接调用脚本类就OKusing System.Collections.Generic;using UnityEditor;using UnityEngine;/// <summary>/// 寻找子物体和其组件/// </summary>public static class FindChildAndComponent {...
2018-10-19 11:24:00 171
转载 任意图形工具
BaseImage.csusing System;using UnityEngine;using System.Collections;using UnityEngine.Serialization;using UnityEngine.UI;public class BaseImage : MaskableGraphic,ISerializationCal...
2018-10-15 11:17:00 138
转载 Debug日志可视化
最近做语音SDK,老是会遇到需要真机测试得问题。真机测试又想看到Debug日志内容。建文本得方式就显得特别傻。于是倒腾了下,弄了哥可视化日志using System.Collections;using System.Collections.Generic;using UnityEngine;public class DebugShow : Mono...
2018-09-29 11:27:00 141
转载 非常好用的游戏数据保存类:ScriptableObject
基础知识:1、将数据储存资源文件中,像普通资源一样管理,退出也会保存修改2、继承自UnityEngine.Object,不必附着在对象上也无需/不能赋给Gameobject或Prefab3、可以被serialised,可以在资源面板创建一个Asset文件,把数据存储在资源文件中,通过属性面板可修改数值。4、可以放到.asset文件中,因此可以自定义我们需要的资源类型5...
2018-09-04 15:14:00 130
转载 时间戳转换
/// <summary> /// 时间戳转为C#格式时间 /// </summary> /// <param name=”timeStamp”></param> /// <returns></returns> private static DateTime ...
2018-09-03 21:38:00 83
转载 关于手机设备网络类型的判断
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class Net : MonoBehaviour{ public Text StrText; // Use this for ini...
2018-09-03 14:07:00 154
转载 compareTo的使用(实现排序功能)
游戏中经常会使用到的分数排序,名字排序CompareTo的比较原理: 先读取出字符串的第一个“字母”进行比较,比较的方法是ascii码表的值(字符所对应的十进制值),如果前面的大那么返回1,后面的大返回-1;此位置相同,继续比较下一位,直到最后一位,如果都相同的话,就返回0;compareTo可以用于实际中什么应用呢??我这里例举使用compareTo进行简...
2017-02-17 15:03:00 1016
转载 AR_Demon(使用vuforia平台提供的钥匙跟后台,实现相机拍图片读取模型以及视频的功能)...
1、https://developer.vuforia.com注册账号。2、分别添加License Manager(连接钥匙),Target Manager(图片后台下载)。3、下载vuforia-unity-6-2-6.unitypackage (46.20 MB),下载Target Manager里面上传的图片。4、打开Unity 加载第三部的两个包。5、如下图uni...
2017-02-13 21:32:00 157
转载 球性插值
1,球性插值代码转载自:http://blog.csdn.net/ZFSR05255134/article/details/51075668根据文章介绍本人对球面插值理解如图using UnityEngine; using System.Collections; /// <summary> /// 在日出和日落之间动画弧线 ...
2016-12-07 10:24:00 309
转载 按住鼠标右键实现摄像头在场景内平滑移动
usingUnityEngine;usingSystem.Collections;//将脚本挂载到摄像机上publicclassCameraController:MonoBehaviour{publicfloatmoveSpeed=10;//设置相机移动速度voidUpdate...
2016-11-29 08:57:00 219
转载 Demo_塔防(自动生成怪物,导航,炮塔攻击,怪物掉血死忙)
using UnityEngine;using System.Collections;public struct WaveMsg{ //该波次生成的怪物 public GameObject monster; //时间间隔 public float waveInterval; //生成个数 public f...
2016-11-01 22:29:00 323
转载 Demo_CS(移动,切换枪支,发射子弹)
using UnityEngine;using System.Collections;public class Gun : MonoBehaviour { private Animator ani; //开火声音 public AudioClip fireClip; //装换子弹声音 public AudioCli...
2016-11-01 22:05:00 136
转载 Demo_玩家移动(主要注意动画的设置)
using UnityEngine;using System.Collections;public class NewPlayerMove : MonoBehaviour { private float hor,ver; private Animator ani; //转身速度 public float turnSpeed ...
2016-11-01 21:48:00 167
转载 Demon_动画控制(实现前后左右移动,喊叫)
using UnityEngine;using System.Collections;public class PlayerAnimation : MonoBehaviour { float ver; private Animator ani; void Awake() { ani = GetCompo...
2016-11-01 21:39:00 132
转载 关卡界面选择
using UnityEngine;using System.Collections;using UnityEngine.UI;public class ShowTitle : MonoBehaviour { void Start() { //获取关卡编号 int index = Singleton.Ge...
2016-11-01 21:19:00 375
转载 Deme_遥感控制物体移动(涉及遮罩,小摄像机跟随)
using UnityEngine;using System.Collections;using UnityEngine.EventSystems;public class JoyController : MonoBehaviour,IDragHandler,IEndDragHandler { //摇杆圆盘半径 public float rad...
2016-11-01 20:52:00 126
转载 Demon_背包系统(实现装备栏,背包栏,可以切换装备)
using UnityEngine;using System.Collections;public enum BoxType{ Normal,//普通格子 Equip//装备栏格子} public enum EquipType{ Weapon,//武器 Armor,//护甲 Shoot//鞋子...
2016-10-29 21:23:00 192
转载 UI几个重要使用方法
using UnityEngine;using System.Collections;using UnityEngine.SceneManagement;public class ApplicationDemo : MonoBehaviour { void Start() { //支持后台运行 Applica...
2016-10-29 20:58:00 126
转载 UGUI的9个重要回调函数
using UnityEngine;using System.Collections;using UnityEngine.EventSystems;//句柄public class ButtonFuc : MonoBehaviour,IPointerEnterHandler,IPointerExitHandler,//进入,离开IPointerDownHa...
2016-10-29 20:54:00 174
转载 Demon_游戏登录界面(具备账号密码输入功能)
using UnityEngine;using System.Collections;using UnityEngine.UI;//public class LoginButton : MonoBehaviour { //正确的用户名密码 public string uname = "wasd"; public string pw...
2016-10-29 20:49:00 204
转载 技能CDDemo(点击鼠标左键实现技能界面旋转)
using UnityEngine;using System.Collections;using UnityEngine.UI;public class HealthController : MonoBehaviour { //当前对象是血条还是蓝条 public bool isHealth = false; //虚拟轴,横轴,纵...
2016-10-29 20:11:00 93
转载 WASD控制UI界面血条加减
using UnityEngine;using System.Collections;using UnityEngine.UI;public class HealthController : MonoBehaviour { //当前对象是血条还是蓝条 public bool isHealth = false; //虚拟轴,横轴,纵...
2016-10-29 20:03:00 175
转载 Demo_敌军坦克生成,坦克移动(可以拓展发射子弹,敌军消失获取分数或者添加动画,声音功能)...
using UnityEngine;using System.Collections;public class Tank : MonoBehaviour { //坦克面积结构体对象 public TankArea tankArea; private float hor, ver; //坦克行走的速度,以及掉头速度 ...
2016-10-29 17:01:00 194
转载 经常会用到的碰撞检测方法
using UnityEngine;using System.Collections;public class PlayerTrigger : MonoBehaviour { void OnTriggerEnter(Collider other) { Debug.Log ("Enter"); } void ...
2016-10-29 16:35:00 205
转载 射线检测
using UnityEngine;using System.Collections;public class RayCastDemo : MonoBehaviour { //射线碰撞检测器 RaycastHit hit; void Update() { //通过鼠标屏幕坐标,生成一条射线对象 ...
2016-10-29 16:31:00 125
转载 Demon_接金币(三个掉落物品预设体,一接物体的工具)
接物体的工具using UnityEngine;using System.Collections;public class Tool : MonoBehaviour { float hor; Vector3 moveDir; public float moveSpeed = 3f; int score = 0;...
2016-10-29 16:20:00 282
转载 Demon_打砖块(建造一面墙,发射子弹打砖块)
using UnityEngine;using System.Collections;public class CubeInit : MonoBehaviour { //砖块预设体 public GameObject cubePrefab; //砖墙宽高 public Vector2 W_H = new Vector2(8,8)...
2016-10-29 16:07:00 165
转载 Demon_Tank (坦克移动发射子弹)
using UnityEngine;using System.Collections;public class Tank : MonoBehaviour { //子弹预设体 public GameObject bullet; //发射点 private Transform firePoint; //移动速度 ...
2016-10-29 15:55:00 146
转载 AddForce给物体添加刚体效果并且脚本增加一个力(按空格实现)
using UnityEngine;using System.Collections;public class CubeAddForce : MonoBehaviour { float hor,ver; //力的方向向量 Vector3 forceDir; //力的大小 public float force = 100...
2016-10-29 15:52:00 1000
转载 Horizontal,vertical,Input_Mouse,Input_Key
鼠标获取using UnityEngine;using System.Collections;public class Input_Mouse : MonoBehaviour { void Update() {// if (Input.GetMouseButtonDown (0)) {// Debug.Log ("按下了鼠标左键");...
2016-10-29 15:44:00 89
转载 按空格按键生成预设体
using UnityEngine;using System.Collections;public class InitGameObject : MonoBehaviour { public GameObject bullet; void Update() { if (Input.GetKeyDown (KeyCode.Space)) {...
2016-10-29 15:42:00 148
转载 Collision使用 获取其组件执行变色操作
using UnityEngine;using System.Collections;public class CyCollision : MonoBehaviour { void OnCollisionEnter(Collision other) {// Debug.Log ("Enter");// Debug...
2016-10-29 15:38:00 148
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人