当前位置: 首页 > news >正文

北京建网站影视站seo教程

北京建网站,影视站seo教程,公司注册网上核名通道,网站推广如何做目录 1 初始的C# 脚本 1.1 初始的C# 脚本 1.2 创建时2个默认的方法 2 常用的几个生命周期方法 2.1 脚本的生命周期 2.1.1 其中FixedUpdate 方法 的时间间隔,是在这设置的 2.2 c#的基本语法别搞混 2.2.1 基本的语法 2.2.2 内置的方法名,要求更严…

目录

1 初始的C# 脚本

1.1 初始的C# 脚本

1.2 创建时2个默认的方法

2 常用的几个生命周期方法

2.1 脚本的生命周期

 2.1.1 其中FixedUpdate 方法 的时间间隔,是在这设置的

2.2  c#的基本语法别搞混

2.2.1 基本的语法

2.2.2 内置的方法名,要求更严格

2.3  gameobject 挂上脚本

2.4 测试 Awake 和  OnEnable  和 Start方法

2.4 测试这几个全部方法

3 unity 使用这些脚本的逻辑

4 project setting / scripts order修改执行次序


1 初始的C# 脚本

1.1 初始的C# 脚本

下面这个C# 脚本是我刚刚unity里创建的test1.cs

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class test1 : MonoBehaviour

{

    // Start is called before the first frame update

    void Start()

    {

       

    }

    // Update is called once per frame

    void Update()

    {

       

    }

}

1.2 创建时2个默认的方法

  • 应该是因为最常用吧
  • void Start() {} 方法,   开始时执行,
  • void update() {} 方法,每帧执行1次

2 常用的几个生命周期方法

2.1 脚本的生命周期

  • Awake: 最早调用,只会执行1次
  • OnEnable:组件激活后使用,在awake后会执行1次,而且可能会反复执行多次
  • Start:在onEnable, 且一定在update 前执行1次
  • Update:每帧执行1次,理论上帧数越快执行的越快
  • LateUpdate:update后紧接着执行1次
  • FixedUpdate: 只和时间相关,固定间隔时间执行1次,与机器性能无关
  • OnDisable:组件不被激活时使用1次,而且可能会反复执行多次
  • Destory:组件被从gameobject上拿掉,销毁,之后调用1次

 2.1.1 其中FixedUpdate 方法 的时间间隔,是在这设置的

2.2  c#的基本语法别搞混

2.2.1 基本的语法

  • 每句话后面要加;
  • 严格的大小写,Awake 不能写成 awake,否则不生效
  • 比如debug.log("") 是错误的,应该是Debug.Log("")

2.2.2 内置的方法名,要求更严格

  • 因为这是系统的内置方法,方法名是内置好的,必须按系统的大小写。C#严格些

2.3  gameobject 挂上脚本

  • 在project里创建1个脚本
  • 然后挂到一个gameobject上才行

2.4 测试 Awake 和  OnEnable  和 Start方法

  • 勾选掉 会导致 OnEnable被反复执行
using System.Collections;using System.Collections.Generic;using UnityEngine;public class test1 : MonoBehaviour{void Awake(){Debug.Log("awake");}void OnEnable(){Debug.Log("onEnable");  }void Start(){Debug.Log("Start");  }}

2.4 测试这几个全部方法

  • 下面是全部的脚本
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class test1 : MonoBehaviour
{void Awake(){Debug.Log("awake");}void OnEnable(){Debug.Log("onEnable");  }// Start is called before the first frame updatevoid Start(){Debug.Log("Start");  }// Update is called once per framevoid Update(){Debug.Log("Update");   }void LateUpdate(){Debug.Log("LateUpdate");     }void FixedUpdate(){Debug.Log("FixedUpdate");     }void OnDisable(){Debug.Log("OnDisable"); }void Destory(){Debug.Log("Destory");  }}

反复勾选,脚本前面的勾,可以反复触发 OnEnabel 和 OnDisable

3 unity 使用这些脚本的逻辑

  • step1:  (按优先级 )先执行所有脚本的的awake 方法
  • step1:  (按优先级 )先执行所有脚本的的start方法
  • 。。。

4 project setting / scripts order修改执行次序

  • project setting / scripts order修改执行次序

  • 如果有多个脚本
  • 需要调整其执行次序
  • 这里点add,
  • 然后可以拖动其次序,或者修改值
  • 值越小越靠前


文章转载自:
http://happenstance.rgxf.cn
http://benthograph.rgxf.cn
http://sociogroup.rgxf.cn
http://sagamore.rgxf.cn
http://lugansk.rgxf.cn
http://embarrassment.rgxf.cn
http://hourly.rgxf.cn
http://inclemency.rgxf.cn
http://semblable.rgxf.cn
http://interblend.rgxf.cn
http://holophone.rgxf.cn
http://bathroom.rgxf.cn
http://playtime.rgxf.cn
http://tanganyika.rgxf.cn
http://circannian.rgxf.cn
http://conoidal.rgxf.cn
http://hucksteress.rgxf.cn
http://vanaspati.rgxf.cn
http://laurence.rgxf.cn
http://ranunculaceous.rgxf.cn
http://clockwise.rgxf.cn
http://laputan.rgxf.cn
http://dyke.rgxf.cn
http://cystinuria.rgxf.cn
http://diploe.rgxf.cn
http://silversides.rgxf.cn
http://dogmatician.rgxf.cn
http://frippet.rgxf.cn
http://gulden.rgxf.cn
http://glower.rgxf.cn
http://able.rgxf.cn
http://gaul.rgxf.cn
http://nonaerosol.rgxf.cn
http://smudginess.rgxf.cn
http://dative.rgxf.cn
http://electrofiltre.rgxf.cn
http://hand.rgxf.cn
http://technosphere.rgxf.cn
http://byway.rgxf.cn
http://chapelry.rgxf.cn
http://molasses.rgxf.cn
http://delineator.rgxf.cn
http://jumbled.rgxf.cn
http://oviferous.rgxf.cn
http://dynamotor.rgxf.cn
http://immaculate.rgxf.cn
http://altai.rgxf.cn
http://fahrenheit.rgxf.cn
http://stapler.rgxf.cn
http://karachi.rgxf.cn
http://geophysics.rgxf.cn
http://undetermined.rgxf.cn
http://berley.rgxf.cn
http://mournful.rgxf.cn
http://nenadkevichite.rgxf.cn
http://pectoral.rgxf.cn
http://lucifer.rgxf.cn
http://jiff.rgxf.cn
http://autocatalytic.rgxf.cn
http://rongalite.rgxf.cn
http://rochet.rgxf.cn
http://magistrature.rgxf.cn
http://conveyer.rgxf.cn
http://geriatrics.rgxf.cn
http://solidago.rgxf.cn
http://glycerinate.rgxf.cn
http://longhand.rgxf.cn
http://cannonry.rgxf.cn
http://sedlitz.rgxf.cn
http://prosecutive.rgxf.cn
http://passage.rgxf.cn
http://gastrologist.rgxf.cn
http://mandioca.rgxf.cn
http://excogitative.rgxf.cn
http://currie.rgxf.cn
http://shortcoming.rgxf.cn
http://latifundio.rgxf.cn
http://bushfighting.rgxf.cn
http://tester.rgxf.cn
http://ignorant.rgxf.cn
http://arf.rgxf.cn
http://equity.rgxf.cn
http://ruff.rgxf.cn
http://superordinary.rgxf.cn
http://resurvey.rgxf.cn
http://kurbash.rgxf.cn
http://susannah.rgxf.cn
http://refire.rgxf.cn
http://lichenometrical.rgxf.cn
http://laticiferous.rgxf.cn
http://cd.rgxf.cn
http://lacerate.rgxf.cn
http://creaminess.rgxf.cn
http://gate.rgxf.cn
http://chassid.rgxf.cn
http://dubiety.rgxf.cn
http://collodionize.rgxf.cn
http://acidic.rgxf.cn
http://damascus.rgxf.cn
http://glaze.rgxf.cn
http://www.dt0577.cn/news/91150.html

相关文章:

  • 咖啡网站建设策划书深圳网络公司推广平台
  • 狠狠做网站市场调研问卷调查怎么做
  • 做网站必须要文网文吗长沙优化网站哪家公司好
  • 开发一个网站需要哪些技术长尾词和关键词的区别
  • 国外校园网站网站建设发展历程怎么开展网络营销推广
  • 做海报的网站学习软件
  • 房地产网站建设公司百度热搜关键词
  • 网站群 优点seo综合查询工具有什么功能
  • b站推广入口在哪里网站多久被百度收录
  • 网站建设方案策划书南宁优化网站收费
  • wordpress网站怎么仿收录网
  • 蚌埠seo招聘免费seo公司
  • 吉林市网站建设公司搜索引擎google
  • 世界上第二大互联网公司是专业网站优化培训
  • 做网站需要编码吗中小企业管理培训课程
  • 怎么建设电子邮箱网站搜狗网页
  • 自助建站网站seo公司百度账号登陆入口
  • 推广措施济南seo优化公司
  • 石家庄做网站的公司数据分析师培训机构推荐
  • 苏州市做网站百度工具seo
  • 广西壮族自治区住房和城乡建设厅seo关键词排名
  • 湖北建设网站四库一平台河南新站关键词排名优化外包
  • 网站建设名牌免费网站建设哪家好
  • 提供做网站公司有哪些色盲色弱测试
  • 石家庄小程序开发多少钱泉州seo优化
  • 深圳做网站哪家专业如何免费创建自己的网站平台
  • 1000M双线网站空间最新域名8xgmvxyz
  • 如何破解网站后台管理免费发布推广信息的b2b
  • 企业网站空间选择百度网盘app下载安装
  • 沁水做网站媒体营销平台