本文整理汇总了C#中BoxCollider.LoadFrom方法的典型用法代码示例。如果您正苦于以下问题:C# BoxCollider.LoadFrom方法的具体用法?C# BoxCollider.LoadFrom怎么用?C# BoxCollider.LoadFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoxCollider
的用法示例。
在下文中一共展示了BoxCollider.LoadFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadComponent
public dynamic LoadComponent(Stream stream, int index, NotLoaded comp)
{
stream.Position = comp.offset;
try
{
switch (comp.classID1)
{
case UnityClassID.AnimationClip:
{
AnimationClip animationClip = new AnimationClip(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, animationClip, comp);
animationClip.LoadFrom(stream);
return animationClip;
}
case UnityClassID.Animator:
{
Animator animator = new Animator(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, animator, comp);
animator.LoadFrom(stream);
return animator;
}
case UnityClassID.AnimatorController:
{
AnimatorController animatorController = new AnimatorController(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, animatorController, comp);
animatorController.LoadFrom(stream);
return animatorController;
}
case UnityClassID.AssetBundle:
{
AssetBundle assetBundle = new AssetBundle(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, assetBundle, comp);
assetBundle.LoadFrom(stream);
return assetBundle;
}
case UnityClassID.AudioClip:
{
if (loadingReferencials)
{
return comp;
}
AudioClip ac = new AudioClip(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, ac, comp);
ac.LoadFrom(stream);
return ac;
}
case UnityClassID.AudioListener:
{
AudioListener audioListener = new AudioListener(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, audioListener, comp);
audioListener.LoadFrom(stream);
return audioListener;
}
case UnityClassID.AudioSource:
{
AudioSource audioSrc = new AudioSource(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, audioSrc, comp);
audioSrc.LoadFrom(stream);
return audioSrc;
}
case UnityClassID.Avatar:
{
if (loadingReferencials)
{
return comp;
}
Avatar avatar = new Avatar(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, avatar, comp);
avatar.LoadFrom(stream);
return avatar;
}
case UnityClassID.BoxCollider:
{
BoxCollider boxCol = new BoxCollider(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, boxCol, comp);
boxCol.LoadFrom(stream);
return boxCol;
}
case UnityClassID.Camera:
{
Camera camera = new Camera(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, camera, comp);
camera.LoadFrom(stream);
return camera;
}
case UnityClassID.CapsuleCollider:
{
CapsuleCollider capsuleCol = new CapsuleCollider(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, capsuleCol, comp);
capsuleCol.LoadFrom(stream);
return capsuleCol;
}
case UnityClassID.Cubemap:
{
Cubemap cubemap = new Cubemap(this, comp.pathID, comp.classID1, comp.classID2);
ReplaceSubfile(index, cubemap, comp);
cubemap.LoadFrom(stream);
Parser.Textures.Add(cubemap);
return cubemap;
}
//.........这里部分代码省略.........