《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)

《UnityAPI.Component组件》

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第1张图片

版本

作者

参与者

完成日期

备注

UnityAPI_Component_V01_1.0

严立钻

 

2020.05.26

 

 

 

 

 

 

 

#《UnityAPI.Component组件》发布说明:

++++“UnityAPI.Component组件是对UnityAPIComponent组件类的剖析和拓展

立钻哥哥:Unity是一个入门快、提高难的游戏引擎,想要提升能力,至少需要越过3道坎:API+Shader+综合能力

++1、API的积累:API的合理利用不仅可以减轻自己的编码负担,而且往往可以提高程序的运行效率;这也是钻哥开始“Unity API”独立打造分类的初衷

++2、Shader编程:想要做出一款精品游戏往往需要有高效的Shader的支持;Unity提供了一套改良的“Shader Lab”系统,优化了繁杂的“Open GL”编程

++3、综合能力(技术+业务+管理):一款产品的制作除了功能编程外,往往会涉及很多其他领域,例如产品架构、UI交互设计、模型制作等,作为主要的编程人员,对其他相关领域的了解程序往往会影响到产品制作直至最后的产品体验

++++立钻哥哥一直在推动【VR云游戏=Unity+SteamVR+云技术+5G+AI,这个只是一个引子,抛砖引玉让大家对整个知识体系有一个明确的落地方向,宝宝们可以根据自己的兴趣方向进行拓展:比如Unity这里是指一种“3D游戏引擎”,也可拓展至“UE4Cocos2dx”等游戏引擎;SteamVR是一种跨硬件解决方案,也可拓展至“VRTK”等第三方插件;“云技术+5G”是一种跨平台解决方案的核心技术,同样可拓展至其他平台解决方案;AI也是一种先进技术的举例,也可以拓展至任何一种前沿技术

 

 

@@提示:有些博客可能只是开了头,如果感兴趣的同学,可以“点赞”或“评论区留言”,只要关注的同学多了,那就会继续完善哟!(“++==”,表示没有写完的,如果关注度不高就不完善了;“++ok++”,表示此篇博客已经完成,是阶段性完整的!)

 

$$$$博客溯源:

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第2张图片

 

++++VR云游戏=Unity+SteamVR+云技术+5G+AI;(说明:AI人工智能不是我们的主要研究技术,只是了解一下,领略一下有风的感觉!但是,VR是我们的研究重点

++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html

++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html

++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html

++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html

++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html

++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/

 

 

 

 

 

 

 

#Component组件

#Component组件

#Component组件

++A1、Description描述

++B2、Variables变量

++C3、Public Function共有函数

++D4、Message消息

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第3张图片

 

 

 

 

#A1、Description描述

#A1、Description描述

++A1、Description描述

++++立钻哥哥:Component(组件)是所有附件到游戏对象的基类

++++[namespace]:UnityEngine

++++[Inherits from]:Object

++++请注意:代码永远不会直接创建一个组件;而是通过编写脚本代码,附加脚本到一个游戏对象上;“ScriptableObject”作为一种方法来创建脚本,不附加到任何游戏对象;

++++[Object]:https://blog.csdn.net/VRunSoftYanlz/article/details/106202194

++++[ScriptableObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106392769

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第4张图片

++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html

++++[Unity快速入门]:https://blog.csdn.net/VRunSoftYanlz/article/details/105776475

++++[UnityAPI目录]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533906

++++[Application应用]:https://blog.csdn.net/VRunSoftYanlz/article/details/106086327

++++[Object对象]:https://blog.csdn.net/VRunSoftYanlz/article/details/106202194

++++[GameObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106223815

++++[MonoBehaviour]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533256

++++[Component组件]:https://blog.csdn.net/VRunSoftYanlz/article/details/106367004

++++[Camera摄像机]:https://blog.csdn.net/VRunSoftYanlz/article/details/106148837

++++[Shader着色器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106321040

++++[Material材质]:https://blog.csdn.net/VRunSoftYanlz/article/details/81814303

++++[Physics物理]:https://blog.csdn.net/VRunSoftYanlz/article/details/106268062

++++[RaycastHit]:https://blog.csdn.net/VRunSoftYanlz/article/details/106292370

++++[ParticleSystem]:https://blog.csdn.net/VRunSoftYanlz/article/details/106341995

++++[WWW万维网]:https://blog.csdn.net/VRunSoftYanlz/article/details/106412890

++++[LineRenerer]:https://blog.csdn.net/VRunSoftYanlz/article/details/106306388

++++[WheelCollider]:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217

++++[MovieTexture]:https://blog.csdn.net/VRunSoftYanlz/article/details/106434063

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第5张图片

 

 

 

 

 

 

 

#B2、Variables变量

#B2、Variables变量

++B2、Variables变量

++++B2.1、animation

++++B2.2、audio

++++B2.3、camera

++++B2.4、collider

++++B2.5、collider2D

++++B2.6、constantForce

++++B2.7、gameObject

++++B2.8、guiText

++++B2.9、guiTexture

++++B2.10、hingeJoint

++++B2.11、light

++++B2.12、networkView

++++B2.13、particleEmitter

++++B2.14、particleSystem

++++B2.15、renderer

++++B2.16、rigidbody

++++B2.17、rigidbody2D

++++B2.18、tag

++++B2.19、transform

++++B2.20、YanlzXREngine.Component.Variables

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第6张图片

 

 

 

++B2.1、animation

++B2.1、animation

++B2.1、animation

++++立钻哥哥:动画

Animation animation;

++++附加到此游戏对象的Animation(如无附加则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        animation.Play();

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.2、audio

++B2.2、audio

++B2.2、audio

++++立钻哥哥:音频

AudioSource audio;

++++附加到此游戏对象的AudioSource(如无附加则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

         audio.Play();

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.3、camera

++B2.3、camera

++B2.3、camera

++++立钻哥哥:摄像机

Camera camera;

++++附加到此游戏对象的Camera(如无附加则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        camera.fieldOfView = 40;

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.4、collider

++B2.4、collider

++B2.4、collider

++++立钻哥哥:碰撞器

Collider collider;

++++附加到此游戏对象的Collider(如无附加则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        collider.material.dynamicFriction = 1;

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.5、collider2D

++B2.5、collider2D

++B2.5、collider2D

++++立钻哥哥:二维碰撞器

Collider2D collider2D;

++++附加到此对象上的Collider2D组件

++++如没有Collider2D被附加则返回空

 

 

 

 

 

++B2.6、constantForce

++B2.6、constantForce

++B2.6、constantForce

++++立钻哥哥:恒力

ConstantForce constantForce;

++++附加到此游戏对象的ConstantForce(如无附加则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        constantForce.relativeForce = new Vector3(0, 0, 1);

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.7、gameObject

++B2.7、gameObject

++B2.7、gameObject

++++立钻哥哥:游戏对象

GameObject gameObject;

++++组件附加的游戏对象;组件总是被附加到游戏对象上

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        Debug.Log(gameObject.name);

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.8、guiText

++B2.8、guiText

++B2.8、guiText

++++立钻哥哥:界面文本

GUIText guiText;

++++附加到此游戏对象GUIText组件(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        guiText.text = 立钻哥哥:Hello world!;

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.9、guiTexture

++B2.9、guiTexture

++B2.9、guiTexture

++++立钻哥哥:界面纹理

GUITexture guiTexture;

++++附加到此游戏对象GUITexture组件(只读);(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        guiTexture.color= Color.bule;

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.10、hingeJoint

++B2.10、hingeJoint

++B2.10、hingeJoint

++++立钻哥哥:铰链关节

HingeJoint hingeJoint;

++++附加到此游戏对象HingeJoint组件(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        hingeJoint.motor.targetVelocity = 5;

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.11、light

++B2.11、light

++B2.11、light

++++立钻哥哥:灯光

Light light;

++++附加到此游戏对象Light组件(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        hingeJoint.motor.targetVelocity = 5;

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.12、networkView

++B2.12、networkView

++B2.12、networkView

++++立钻哥哥:网络视图

NetworkView networkView;

++++附加到此游戏对象NetworkView组件(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        networkView.RPC(MyFunction, RPCMode.All, someValue);

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.13、particleEmitter

++B2.13、particleEmitter

++B2.13、particleEmitter

++++立钻哥哥:粒子发射器

ParticleEmitter particleEmitter;

++++附加到此游戏对象ParticleEmitter组件(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        networkView.RPC(MyFunction, RPCMode.All, someValue);

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.14、particleSystem

++B2.14、particleSystem

++B2.14、particleSystem

++++立钻哥哥:粒子系统

ParticleSystem particleSystem;

++++附加到此游戏对象ParticleSystem组件(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        particleSystem.Emit(5);

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.15、renderer

++B2.15、renderer

++B2.15、renderer

++++立钻哥哥:渲染器

Renderer renderer;

++++附加到此游戏对象Renderer组件(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        renderer.material.color = Color.red;

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.16、rigidbody

++B2.16、rigidbody

++B2.16、rigidbody

++++立钻哥哥:刚体

Rigidbody rigidbody;

++++附加到此游戏对象Rigidbody组件(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        rigidbody.AddForce(1, 1, 1);

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.17、rigidbody2D

++B2.17、rigidbody2D

++B2.17、rigidbody2D

++++立钻哥哥:二维刚体

Rigidbody2D rigidbody2D;

++++附加到此游戏对象Rigidbody2D组件

++++如果Rigidbody2D被附加,此属性将为空

 

 

 

 

 

++B2.18、tag

++B2.18、tag

++B2.18、tag

++++立钻哥哥:标签

string tag;

++++此游戏对象的标签

++++标签可以用于标识游戏对象;标签必须在使用之前在标签管理器里面先声明

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        Debug.Log(立钻哥哥:Transform Tag is: + tag);

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++B2.19、transform

++B2.19、transform

++B2.19、transform

++++立钻哥哥:变换

Transform transform;

++++附加到此游戏对象Transform组件(如果没有则为空)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    void MyTestFunc(){

        transform.Translate(1, 1, 1);

    }

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

 

 

#C3、Functions函数

#C3、Functions函数

++C3、Functions函数

++++C3.1、BroadcastMessage

++++C3.2、CompareTag

++++C3.3、GetComponent

++++C3.4、GetComponentInChildren

++++C3.5、GetComponentInParent

++++C3.6、GetComponents

++++C3.7、GetComponentsInChildren

++++C3.8、GetComponentsInParent

++++C3.9、SendMessage

++++C3.10、SendMessageUpwards

++++C3.11、YanlzXREngine.Component.Functions

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第7张图片

 

 

 

++C3.1、BroadcastMessage

++C3.1、BroadcastMessage

++C3.1、BroadcastMessage

++++立钻哥哥:广播消息

void BroadcastMessage(string methodName, object parameter=null, SendMessageOptions options=SendMessageOptions.RequireReceiver);

void BroadcastMessage(string methodName, SendMessageOptions options);

++++[methodName]:要调用的方法名

++++[parameter]:可选参数,要传递的方法名(可以是任何值)

++++[options]:如果用于给定的目标对象方法不存在,应该抛出错误么

++++在该游戏对象的和它的全部子对象上每一MonoBehaviour调用名为methodName的方法

++++接受消息的方法可以通过不要参数的方法来选择忽略参数,当选项被设置为SendMessageOptions.RequireReceiver时,如果消息没有被任何一个组件处理,则会打印一个错误

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

 

    void MyApplyDamage(float damage){

        Debug.Log(damage);

    }    //立钻哥哥:void MyApplyDamage(){}

 

    void MyTestFunc(){

        BroadcastMessage(MyApplyDamage, 5.0F);

    }    //立钻哥哥:void MyTestFunc(){}

 

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++C3.2、CompareTag

++C3.2、CompareTag

++C3.2、CompareTag

++++立钻哥哥:比较标签

bool CompareTag(string tag);

++++[tag]:要比较的标签

++++此游戏对象是否被标记为tag标签?

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

 

    void OnTriggerEnter(Collider other){

        if(other.CompareTag(MyPlayer)){

            Destroy(other.gameObject);

        }    

    }    //立钻哥哥:void OnTriggerEnter(){}

 

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++C3.3、GetComponent

++C3.3、GetComponent

++C3.3、GetComponent

++++立钻哥哥:获取组件

Component GetComponent(Type type);

T GetComponent();

Component GetComponent(string type);

++++[type]:要获取的组件类型

++++如果游戏对象有附加type类型的组件,则返回;如果没有则为空

++++由于性能原因,最好使用TypeGetComponent,而不是用字符串;不过有时可能无法得到Type,可以简单通过名字而不是type来访问组件

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    public HingeJoint hinge;

 

    void MyTestFunc(){

        //hinge = GetComponent(HingeJoint) as HingeJoint;

        hinge = GetComponent<HingeJoint>();

 

        hinge.useSpring = false;

    }    //立钻哥哥:void MyTestFunc(){}

 

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++C3.4、GetComponentInChildren

++C3.4、GetComponentInChildren

++C3.4、GetComponentInChildren

++++立钻哥哥:获取子对象组件

Component GetComponentInChildren(Type t);

T GetComponentInChildren();

++++[t]:要获取组件的类型

++++返回此游戏对象上type类型的组件或任何它的子对象,使用深度首先搜索

++++只返回激活的组件

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    public HingeJoint hinge;

 

    void MyTestFunc(){

        //hinge = GetComponent<HingeJoint>();

        hinge = GetComponentInChildren<HingeJoint>();

 

        hinge.useSpring = false;

    }    //立钻哥哥:void MyTestFunc(){}

 

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++C3.5、GetComponentInParent

++C3.5、GetComponentInParent

++C3.5、GetComponentInParent

++++立钻哥哥:获取父对象组件

Component GetComponentInParent(Type t);

++++[t]:获取组件的类型

++++返回此对象或任何它的父对象type类型的组件

++++仅返回激活的组件

立钻哥哥:Returns the component of Type /type/ in the GameObject or any of its parents.

 

 

 

 

 

++C3.6、GetComponents

++C3.6、GetComponents

++C3.6、GetComponents

++++立钻哥哥:获取组件列表

Component[] GetComponents(Type type);

T[] GetComponents();

++++[type]:检索组件的类型

++++返回此对象type类型的所有组件

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    public HingeJoint[] hingeJoints;

 

    void MyTestFunc(){

        hingeJoints = GetComponents<HingeJoint>();

 

        foreach(HingeJoint joint in hingeJoints){

            joint.useSpring = false;

        }

    }    //立钻哥哥:void MyTestFunc(){}

 

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++C3.7、GetComponentsInChildren

++C3.7、GetComponentsInChildren

++C3.7、GetComponentsInChildren

++++立钻哥哥:获取子对象组件列表

Component[] GetComponentsInChildren(Type t, bool includeInactive=false);

T[] GetComponentsInChildren(bool includeInactive);

T[] GetComponentsInChildren();

++++[t]:检索组件的类型

++++[includeInactive]:在查找集里面应该包括非激活的组件吗?

++++返回此游戏对象与其子对象所有type类型的组件

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    public HingeJoint[] hingeJoints;

 

    void MyTestFunc(){

        //hingeJoints = GetComponents<HingeJoint>();

        hingeJoints = GetComponentsInChildren<HingeJoint>();

 

        foreach(HingeJoint joint in hingeJoints){

            joint.useSpring = false;

        }

    }    //立钻哥哥:void MyTestFunc(){}

 

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++C3.8、GetComponentsInParent

++C3.8、GetComponentsInParent

++C3.8、GetComponentsInParent

++++立钻哥哥:获取父对象组件列表

Component[] GetComponentsInParent(Type t, bool includeInactive=false);

T[] GetComponentsInParent(bool includeInactive);

T[] GetComponentsInParent();

++++[t]:检索组件的类型

++++[includeInactive]:在查找集里面应该包括非激活的组件吗?

++++返回此游戏对象与其父对象所有type类型的组件

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

    public HingeJoint[] hingeJoints;

 

    void MyTestFunc(){

        hingeJoints = gameObject.GetComponentsInParent(typeof(HingeJoint));

 

        foreach(HingeJoint joint in hingeJoints){

            joint.useSpring = false;

        }

    }    //立钻哥哥:void MyTestFunc(){}

 

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++C3.9、SendMessage

++C3.9、SendMessage

++C3.9、SendMessage

++++立钻哥哥:发送消息

void SendMessage(string methodName, object value=null, SendMessageOptions options=SendMessageOptions.RequireReceiver);

void SendMessage(string methodName, SendMessageOptions options);

++++[methodName]:调用的方法名

++++[value]:可选参数,被调用的方法传递的值

++++[options]:如果目标对象方法不存在,应该引发错误吗?

++++在此游戏对象所有MonoBehaviour上调用名称为methodName的方法

++++接收消息的方法可以通过不要参数的方法来选择忽略参数;当选项被设置为SendMessageOptions.RequireReceiver时,如果消息没有被任何一个组件处理,则打印一个错误

++++注意:消息不会发送到非激活的对象上(如:那些在编辑器或者通过GameObject.SetActive已经关闭的对象)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

 

    void MyApplyDamage(float damage){

        Debug.Log(damage);

    }    //立钻哥哥:void MyApplyDamage(){}

 

    void MyTestFunc(){

        //BroadcastMessage(MyApplyDamage, 5.0F);

        SendMessage(MyApplyDamage, 5.0F);

    }    //立钻哥哥:void MyTestFunc(){}

 

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

++C3.10、SendMessageUpwards

++C3.10、SendMessageUpwards

++C3.10、SendMessageUpwards

++++立钻哥哥:向上发送消息

void SendMessageUpwards(string methodName, object value=null, SendMessageOptions options=SendMessageOptions.RequireReceiver);

void SendMessageUpwards(string methodName, SendMessageOptions options);

++++[methodName]:调用的方法名

++++[value]:可选参数,被调用的方法传递的值

++++[options]:如果目标对象方法不存在,应该引发错误吗?

++++在此游戏对象及其behaviour的父对象上所有MonoBehaviour上调用名称为methodName的方法

++++接收消息的方法可以通过不要参数的方法来选择忽略参数;当选项被设置为SendMessageOptions.RequireReceiver时,如果消息没有被任何一个组件处理,则打印一个错误

++++注意:消息不会发送到非激活的对象上(如:那些在编辑器或者通过GameObject.SetActive已经关闭的对象)

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzComponent : MonoBehaviour{

 

    void MyApplyDamage(float damage){

        Debug.Log(damage);

    }    //立钻哥哥:void MyApplyDamage(){}

 

    void MyTestFunc(){

        //BroadcastMessage(MyApplyDamage, 5.0F);

        //SendMessage(MyApplyDamage, 5.0F);

        SendMessageUpwards(MyApplyDamage, 5.0F);

    }    //立钻哥哥:void MyTestFunc(){}

 

}    //立钻哥哥:public class YanlzComponent{}

 

 

 

 

 

 

 

#D4、立钻哥哥对Component类的拓展

#D4、立钻哥哥对Component类的拓展

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第8张图片

++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html

++++[Unity快速入门]:https://blog.csdn.net/VRunSoftYanlz/article/details/105776475

++++[UnityAPI目录]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533906

++++[Application应用]:https://blog.csdn.net/VRunSoftYanlz/article/details/106086327

++++[Object对象]:https://blog.csdn.net/VRunSoftYanlz/article/details/106202194

++++[Component组件]:https://blog.csdn.net/VRunSoftYanlz/article/details/106367004

++++ [Unity面向组件]:https://blog.csdn.net/VRunSoftYanlz/article/details/78881752 

++++[GameObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106223815

++++[Camera摄像机]:https://blog.csdn.net/VRunSoftYanlz/article/details/106148837

++++[Shader着色器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106321040

++++[Physics物理]:https://blog.csdn.net/VRunSoftYanlz/article/details/106268062

++++[RaycastHit]:https://blog.csdn.net/VRunSoftYanlz/article/details/106292370

++++[ParticleSystem]:https://blog.csdn.net/VRunSoftYanlz/article/details/106341995

++++[WWW万维网]:https://blog.csdn.net/VRunSoftYanlz/article/details/106412890

++++[LineRenerer]:https://blog.csdn.net/VRunSoftYanlz/article/details/106306388

++++[WheelCollider]:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217

++++[MovieTexture]:https://blog.csdn.net/VRunSoftYanlz/article/details/106434063

++++[Matrix4x4矩阵]:https://blog.csdn.net/VRunSoftYanlz/article/details/106504027

++++[Renerer渲染器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106481994

++++[AudioSource]:https://blog.csdn.net/VRunSoftYanlz/article/details/106462679

++++[AudioClip]:https://blog.csdn.net/VRunSoftYanlz/article/details/106448955

++++[Texture纹理]:https://blog.csdn.net/VRunSoftYanlz/article/details/106448589

++++[AssetBundle]:https://blog.csdn.net/VRunSoftYanlz/article/details/106412190

++++[ScriptableObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106392769

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第9张图片

 

 

 

 

 

@@提示:有些博客可能只是开了头,如果感兴趣的同学,可以“点赞”或“评论区留言”,只要关注的同学多了,那就会继续完善哟!(“++==”,表示没有写完的,如果关注度不高就不完善了;“++ok++”,表示此篇博客已经完成,是阶段性完整的!)

 

 

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第10张图片

++++VR云游戏=Unity+SteamVR+云技术+5G+AI;(说明:AI人工智能不是我们的主要研究技术,只是了解一下,领略一下有风的感觉!但是,VR是我们的研究重点

++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html

++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html

++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html

++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html

++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html

++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/

 

 

 

 

【XR游戏开发QQ群:784477094

++立钻哥哥推荐的拓展学习链接(Link_Url)

立钻哥哥推荐的拓展学习链接(Link_Url)

++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/

++++虚拟现实VR资讯: https://blog.csdn.net/VRunSoftYanlz/article/details/89165846

++++HTC_VIVE开发基础https://blog.csdn.net/VRunSoftYanlz/article/details/81989970

++++Oculus杂谈https://blog.csdn.net/VRunSoftYanlz/article/details/82469850

++++Oculus安装使用https://blog.csdn.net/VRunSoftYanlz/article/details/82718982

++++Unity+SteamVR=>VRhttps://blog.csdn.net/VRunSoftYanlz/article/details/88809370

++++Unity减少VR晕眩症https://blog.csdn.net/VRunSoftYanlz/article/details/89115518

++++SteamVR简介https://blog.csdn.net/VRunSoftYanlz/article/details/86484254

++++SteamVR脚本功能分析https://blog.csdn.net/VRunSoftYanlz/article/details/86531480

++++SteamVR2.0开发指南https://blog.csdn.net/VRunSoftYanlz/article/details/86618187

++++SteamVR2.2.0开发指南https://blog.csdn.net/VRunSoftYanlz/article/details/88784527

++++SteamVR2.2.0快速入门https://blog.csdn.net/VRunSoftYanlz/article/details/88833579

++++SteamVR2.2.0交互系统https://blog.csdn.net/VRunSoftYanlz/article/details/89199778

++++SteamVR2.2.0传送机制https://blog.csdn.net/VRunSoftYanlz/article/details/89390866

++++SteamVR2.2.0教程(一)https://blog.csdn.net/VRunSoftYanlz/article/details/89324067

++++SteamVR2.2.0教程(二)https://blog.csdn.net/VRunSoftYanlz/article/details/89894097

++++SteamVR_Skeleton_Poserhttps://blog.csdn.net/VRunSoftYanlz/article/details/89931725

++++SteamVR实战之PMCorehttps://blog.csdn.net/VRunSoftYanlz/article/details/89463658

++++SteamVR/Extrashttps://blog.csdn.net/VRunSoftYanlz/article/details/86584108

++++SteamVR/Inputhttps://blog.csdn.net/VRunSoftYanlz/article/details/86601950

++++OpenXR简介https://blog.csdn.net/VRunSoftYanlz/article/details/85726365

++++VRTK杂谈https://blog.csdn.net/VRunSoftYanlz/article/details/82562993

++++VRTK快速入门(杂谈)https://blog.csdn.net/VRunSoftYanlz/article/details/82955267

++++VRTK官方示例(目录)https://blog.csdn.net/VRunSoftYanlz/article/details/82955410

++++VRTK代码结构(目录)https://blog.csdn.net/VRunSoftYanlz/article/details/82780085

++++VRTK(SceneResources)https://blog.csdn.net/VRunSoftYanlz/article/details/82795400

++++VRTK_ControllerEventshttps://blog.csdn.net/VRunSoftYanlz/article/details/83099512

++++VRTK_InteractTouchhttps://blog.csdn.net/VRunSoftYanlz/article/details/83120220

++++虚拟现实行业应用https://blog.csdn.net/VRunSoftYanlz/article/details/88360157

++++Steam平台上的VRhttps://blog.csdn.net/VRunSoftYanlz/article/details/88960085

++++Steam平台热销VRhttps://blog.csdn.net/VRunSoftYanlz/article/details/89007741

++++VR实验:以太网帧的构成https://blog.csdn.net/VRunSoftYanlz/article/details/82598140

++++实验四:存储器扩展实验https://blog.csdn.net/VRunSoftYanlz/article/details/87834434

++++FrameVR示例V0913https://blog.csdn.net/VRunSoftYanlz/article/details/82808498

++++FrameVR示例V1003https://blog.csdn.net/VRunSoftYanlz/article/details/83066516

++++SwitchMachineV1022https://blog.csdn.net/VRunSoftYanlz/article/details/83280886

++++PlaySceneManagerV1022https://blog.csdn.net/VRunSoftYanlz/article/details/83280886

++++Unity5.x用户手册https://blog.csdn.net/VRunSoftYanlz/article/details/81712741

++++Unity面试题ABChttps://blog.csdn.net/vrunsoftyanlz/article/details/78630687

++++Unity面试题Dhttps://blog.csdn.net/VRunSoftYanlz/article/details/78630838

++++Unity面试题Ehttps://blog.csdn.net/vrunsoftyanlz/article/details/78630913

++++Unity面试题Fhttps://blog.csdn.net/VRunSoftYanlz/article/details/78630945

++++Cocos2dx面试题https://blog.csdn.net/VRunSoftYanlz/article/details/78630967

++++禅道[zentao]https://blog.csdn.net/VRunSoftYanlz/article/details/83964057

++++Lua快速入门篇(Xlua拓展):https://blog.csdn.net/VRunSoftYanlz/article/details/81173818

++++Lua快速入门篇(XLua教程):https://blog.csdn.net/VRunSoftYanlz/article/details/81141502

++++Lua快速入门篇(基础概述)https://blog.csdn.net/VRunSoftYanlz/article/details/81041359

++++框架知识点https://blog.csdn.net/VRunSoftYanlz/article/details/80862879

++++游戏框架(UI框架夯实篇)https://blog.csdn.net/vrunsoftyanlz/article/details/80781140

++++游戏框架(初探篇)https://blog.csdn.net/VRunSoftYanlz/article/details/80630325

++++.Net框架设计https://blog.csdn.net/VRunSoftYanlz/article/details/87401225

++++从零开始学架构https://blog.csdn.net/VRunSoftYanlz/article/details/88095895

++++设计模式简单整理https://blog.csdn.net/vrunsoftyanlz/article/details/79839641

++++专题:设计模式(精华篇)https://blog.csdn.net/VRunSoftYanlz/article/details/81322678

++++U3D小项目参考https://blog.csdn.net/vrunsoftyanlz/article/details/80141811

++++Unity小游戏算法分析https://blog.csdn.net/VRunSoftYanlz/article/details/87908365

++++Unity案例(Vehicle)https://blog.csdn.net/VRunSoftYanlz/article/details/82355876

++++UML类图https://blog.csdn.net/vrunsoftyanlz/article/details/80289461

++++PowerDesigner简介https://blog.csdn.net/VRunSoftYanlz/article/details/86500084

++++Unity知识点0001https://blog.csdn.net/vrunsoftyanlz/article/details/80302012

++++Unity知识点0008https://blog.csdn.net/VRunSoftYanlz/article/details/81153606

++++U3D_Shader编程(第一篇:快速入门篇)https://blog.csdn.net/vrunsoftyanlz/article/details/80372071

++++U3D_Shader编程(第二篇:基础夯实篇)https://blog.csdn.net/vrunsoftyanlz/article/details/80372628

++++Unity引擎基础https://blog.csdn.net/vrunsoftyanlz/article/details/78881685

++++Unity面向组件开发https://blog.csdn.net/vrunsoftyanlz/article/details/78881752

++++Unity物理系统https://blog.csdn.net/vrunsoftyanlz/article/details/78881879

++++Unity2D平台开发https://blog.csdn.net/vrunsoftyanlz/article/details/78882034

++++UGUI基础https://blog.csdn.net/vrunsoftyanlz/article/details/78884693

++++UGUI进阶https://blog.csdn.net/vrunsoftyanlz/article/details/78884882

++++UGUI综合https://blog.csdn.net/vrunsoftyanlz/article/details/78885013

++++Unity动画系统基础https://blog.csdn.net/vrunsoftyanlz/article/details/78886068

++++Unity动画系统进阶https://blog.csdn.net/vrunsoftyanlz/article/details/78886198

++++Navigation导航系统https://blog.csdn.net/vrunsoftyanlz/article/details/78886281

++++Unity特效渲染https://blog.csdn.net/vrunsoftyanlz/article/details/78886403

++++Unity数据存储https://blog.csdn.net/vrunsoftyanlz/article/details/79251273

++++Unity中Sqlite数据库https://blog.csdn.net/vrunsoftyanlz/article/details/79254162

++++WWW类和协程https://blog.csdn.net/vrunsoftyanlz/article/details/79254559

++++Unity网络https://blog.csdn.net/vrunsoftyanlz/article/details/79254902

++++Unity资源加密https://blog.csdn.net/VRunSoftYanlz/article/details/87644514

++++PhotonServer简介https://blog.csdn.net/VRunSoftYanlz/article/details/86652770

++++编写Photon游戏服务器https://blog.csdn.net/VRunSoftYanlz/article/details/86682935

++++C#事件https://blog.csdn.net/vrunsoftyanlz/article/details/78631267

++++C#委托https://blog.csdn.net/vrunsoftyanlz/article/details/78631183

++++C#集合https://blog.csdn.net/vrunsoftyanlz/article/details/78631175

++++C#泛型https://blog.csdn.net/vrunsoftyanlz/article/details/78631141

++++C#接口https://blog.csdn.net/vrunsoftyanlz/article/details/78631122

++++C#静态类https://blog.csdn.net/vrunsoftyanlz/article/details/78630979

++++C#中System.String类https://blog.csdn.net/vrunsoftyanlz/article/details/78630945

++++C#数据类型https://blog.csdn.net/vrunsoftyanlz/article/details/78630913

++++Unity3D默认的快捷键https://blog.csdn.net/vrunsoftyanlz/article/details/78630838

++++游戏相关缩写https://blog.csdn.net/vrunsoftyanlz/article/details/78630687

++++UnityAPI.Rigidbody刚体https://blog.csdn.net/VRunSoftYanlz/article/details/81784053

++++UnityAPI.Material材质https://blog.csdn.net/VRunSoftYanlz/article/details/81814303

++++UnityAPI.Android安卓https://blog.csdn.net/VRunSoftYanlz/article/details/81843193

++++UnityAPI.AndroidJNI安卓JNIhttps://blog.csdn.net/VRunSoftYanlz/article/details/81879345

++++UnityAPI.Transform变换https://blog.csdn.net/VRunSoftYanlz/article/details/81916293

++++UnityAPI.WheelCollider轮碰撞器https://blog.csdn.net/VRunSoftYanlz/article/details/82356217

++++UnityAPI.Resources资源https://blog.csdn.net/VRunSoftYanlz/article/details/83155518

++++JSON数据结构https://blog.csdn.net/VRunSoftYanlz/article/details/82026644

++++CocosStudio快速入门https://blog.csdn.net/VRunSoftYanlz/article/details/82356839

++++Unity企业内训(目录)https://blog.csdn.net/VRunSoftYanlz/article/details/82634668

++++Unity企业内训(第1讲)https://blog.csdn.net/VRunSoftYanlz/article/details/82634733

++++Unity企业内训(第2讲)https://blog.csdn.net/VRunSoftYanlz/article/details/82861180

++++Unity企业内训(第3讲)https://blog.csdn.net/VRunSoftYanlz/article/details/82927699

++++Unity企业内训(第4讲)https://blog.csdn.net/VRunSoftYanlz/article/details/83479776

++++Unity企业内训(第5讲)https://blog.csdn.net/VRunSoftYanlz/article/details/83963811

++++Unity企业内训(第6讲)https://blog.csdn.net/VRunSoftYanlz/article/details/84207696

++++钻哥带您了解产品原型https://blog.csdn.net/VRunSoftYanlz/article/details/87303828

++++插件https://blog.csdn.net/VRunSoftYanlz/article/details/83963905

++++计算机组成原理(教材篇)https://blog.csdn.net/VRunSoftYanlz/article/details/82719129

++++5G接入:云计算和雾计算https://blog.csdn.net/VRunSoftYanlz/article/details/88372718

++++云计算通俗讲义https://blog.csdn.net/VRunSoftYanlz/article/details/88652803

++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz

--_--VRunSoft:lovezuanzuan--_--

《UnityAPI.Component组件》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+GetComponent+SendMessage+Tag+立钻哥哥++OK++)_第11张图片

你可能感兴趣的:(VR云游戏实战零碎技术点,Unity开发基础,UnityAPI)