• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
wayne1984
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

09 2020 档案

 
Unity 创建和调用TimeLine
摘要:1 在Window里面打开Timeline窗口2 在场景中新建一个空物体,选择正规空物体,在timeline窗口中新建一个Timeline3 制作Timeline动画4 关闭PlayAwake,用脚本来控制5 脚本 using UnityEngine.Playables; public Playab 阅读全文
posted @ 2020-09-28 17:29 wayne1984 阅读(2183) 评论(0) 推荐(0)
Unity 代码简单与复杂写法
摘要:uiCtrl?.EndDraw(); 等同于 if(uiCtrl != null) uiCtrl.EndDraw(); 阅读全文
posted @ 2020-09-24 14:11 wayne1984 阅读(215) 评论(0) 推荐(0)
unity 禁用\启用\添加\删除组件的方法
摘要://关闭组件 skills.transform.GetComponent<Rigidbody>().enabled = false; //禁用与变灰 skills[3].GetComponent<Rigidbody>().interactable = false; // 动态给对象添加刚体组件 ob 阅读全文
posted @ 2020-09-18 16:38 wayne1984 阅读(6502) 评论(1) 推荐(1)
Unity 脚本的开和关
摘要:GameObject.Find("ObjectName").GetComponent<scriptName>().enabled=true/false; 阅读全文
posted @ 2020-09-18 16:27 wayne1984 阅读(326) 评论(0) 推荐(0)
Unity 改变材质球颜色
摘要:public Material mat; mat.color =new Color(1,1,1,1); 阅读全文
posted @ 2020-09-15 11:23 wayne1984 阅读(1189) 评论(0) 推荐(0)
Unity中Invoke和InvokeRepeating的使用
摘要:Invoke: Invoke()是Unity中内置的一个回调机制。 void Invoke(string methodName,float time) : 意思是在等待time之后,再调用方法methodName方法。 实例:延时2秒后执行Running方法。 注: 1)、Invoke() : 不能 阅读全文
posted @ 2020-09-11 16:36 wayne1984 阅读(2538) 评论(0) 推荐(0)
Unity 实现人偶击飞效果
摘要:首先全身对应骨骼添加 CapsuleCollider --Rigidbody Character Joint (Connected Body ,选择上一节) 后面在死亡同时,关闭Animation 阅读全文
posted @ 2020-09-09 16:45 wayne1984 阅读(1169) 评论(0) 推荐(0)
unity Animator 随机动作
摘要:string[]names={"H_L","H_R","H_T"}; void Attack() { System.Random rnd=new System.Random(); int index = rnd.Next(names.Length); string name = names[inde 阅读全文
posted @ 2020-09-08 18:13 wayne1984 阅读(693) 评论(0) 推荐(0)
Untiy 协程
摘要:public class XXX : MonoBehaviour { // Update is called once per frame void Update () { StartCoroutine(load()); //这里是加载执行类,注意使用的是StartCoroutine } // // 阅读全文
posted @ 2020-09-05 10:47 wayne1984 阅读(108) 评论(0) 推荐(0)
Unity 在面板中直接选择Key
摘要:public KeyCode _key; 可以得到所以的Key在面板中选择 if (Input.GetKeyDown(_key)) { //当按下Key,button按钮被点击 _button.onClick.Invoke(); _animator.SetTrigger("IsDown"); Ins 阅读全文
posted @ 2020-09-04 17:43 wayne1984 阅读(194) 评论(0) 推荐(0)
Unity UI Image 环形进度条
摘要:UI Image 环形进度条 1 做一张环形PNG,导入Unity设置为Sprite; 2 UI创建 Image 修改 Image Type 修改为 Filled 3 脚本控制 FillAmount; public Image HpImage;//那个图 public float x;//变量,一般 阅读全文
posted @ 2020-09-04 17:08 wayne1984 阅读(680) 评论(0) 推荐(0)
Unity 随机Trigger动画
摘要:public string[]_AniName=new string[]{"animation1","animation2", "animation3","Foot1","Foot2","Foot3"}; int index = Random.Range(0, _AniName.Length); D 阅读全文
posted @ 2020-09-04 15:21 wayne1984 阅读(423) 评论(0) 推荐(0)
Untiy Animator.StringToHash
摘要:private int a = Animator.StringToHash("animation1"); animator.SetTrigger(a); 阅读全文
posted @ 2020-09-04 10:08 wayne1984 阅读(438) 评论(0) 推荐(0)
Unity 特效是否对着摄像机设置
摘要:renderer--render alignment 设置为Local 阅读全文
posted @ 2020-09-03 20:24 wayne1984 阅读(469) 评论(0) 推荐(0)
Unity 克隆成为目标的子物体
摘要:GameObject a = Instantiate(sfx_a, sfxP_a.transform.position, sfxP_a.transform.rotation); a.transform.parent = sfxP_a.transform; 阅读全文
posted @ 2020-09-03 19:30 wayne1984 阅读(484) 评论(0) 推荐(0)
UGUI面板中特效显示解决方案
摘要:UGUI面板中特效显示解决方案 问题 在ugui使用中发现制作的特效没办法在ugui面板中显示,对particleSystem进行了各种设置包括修改层级等等,都无法显示。 解决方案 可以发现ugui没有像ngui那样的UICamera,这样我们可以尝试自己添加个UICamera去进行显示,但是通常创 阅读全文
posted @ 2020-09-03 14:00 wayne1984 阅读(488) 评论(0) 推荐(0)
unity Random.Range随机
摘要:time = Random.Range(5d,12f); 阅读全文
posted @ 2020-09-02 10:03 wayne1984 阅读(1147) 评论(0) 推荐(0)
获取Tag,修改Tag
摘要:GameObject mobj = GameObject . FindGameObjectWithTag(“1”);找到Tag名字为1的obj mobj.tag=“2”;给他改名为2 阅读全文
posted @ 2020-09-01 15:19 wayne1984 阅读(337) 评论(0) 推荐(0)
 

公告


博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3