unity readmessage动画read only怎么消除掉

进口fbx角色动画read-only解
时间: 13:56:05
&&&& 阅读:82
&&&& 评论:
&&&& 收藏:0
unity4.3版本号
You can use an editor script that copies over the curves from the original imported Animation Clip into the duplicated Animation Clip.
Here is such an editor script.
And the script:
There is more simple variant. This script creates a new animation file itself and makes all copying operations.
Guys, I loved this script so much, I went ahead and added a couple of features.
Here is a modified version of MaDDoX‘s edit that includes logic for automatically placing the animations into folders.
It first uses an animations folder to contain them all and then if the animation came from an FBX file, it will use the FBX‘s name to create a subfolder for those animations. Hopefully, this helps y‘all keep things organized.
&&国之画&&&& &&&&chrome插件&&
版权所有 京ICP备号-2
迷上了代码!3D游戏中,经常遇到这样的情况。角色模型上需要显示角色名字或者血条等信息。
如果用一个摄像机会有可能出现名字或血条显示不正常等问题,所以我采用两个摄像机。一个渲染名字或血条等UI,另一个渲染角色模型。
下面以NGUI为例,实现这一功能。
如图所示,一个相机负责渲染UI,另外一个负责渲染游戏场景。
再添加脚本NamePanel,代码如下:
description:英雄名字面板
using UnityE
using System.C
public class NamePanel : MonoBehaviour
[SerializeField]
UILabel lblN
[SerializeField]
[SerializeField]
Camera mainC
[SerializeField]
Camera uiC
void Update()
UpdateNamePosition();
Vector3 m_
/// &summary&
/// 更新名字位置
/// &/summary&
void UpdateNamePosition()
//取模型在主摄像机中的世界坐标
m_position = obj.transform.
//转换为主摄像机的屏幕坐标
m_position = mainCamera.WorldToScreenPoint(m_position);
//用得到的屏幕坐标,在UI摄像机中转换为世界坐标
m_position = uiCamera.ScreenToWorldPoint(m_position);
m_position.z = 0f;
m_position.y += 0.1f;
lblName.transform.position = m_
在Update中更新坐标,实际使用按照具体情况。这里是以屏幕坐标为参考,同时也可以用视口坐标。
将脚本挂在GameManager上,其中:Obj是角色模型。
&然后点击运行,就会发现名字面板紧跟着模型
阅读(...) 评论()转载请注明出处:http://blog.csdn.net/farmer_cc/article/details/
Android 动画animation 深入分析
前言:本文试图通过分析动画流程,来理解android动画系统的设计与实现,学习动画的基本原则,最终希望能够指导动画的设计。
0 本文中用到的一些类图
1 view animation&
调用方法:view.startAnimation(animation);
public void startAnimation(Animation animation) {
animation.setStartTime(Animation.START_ON_FIRST_FRAME);
setAnimation(animation);
invalidateParentCaches();
invalidate(true);
}在invalidate(ture);中
if (p != null && ai != null) {
final Rect r = ai.mTmpInvalR
r.set(0, 0, mRight - mLeft, mBottom - mTop);
// Don't call invalidate -- we don't want to internally scroll
// our own bounds
p.invalidateChild(this, r);
即调用parent的invalidateChild,
假定父控件即为ViewRootI
public final class ViewRootImpl implements ViewP
public void invalidateChild(View child, Rect dirty) {
invalidateChildInParent(null, dirty);
public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
//...省略一堆判断条件,最终调用
if (!mWillDrawSoon && (intersected || mIsAnimating)) {
scheduleTraversals();
void scheduleTraversals() {
if (!mTraversalScheduled) {
mTraversalScheduled =
mTraversalBarrier = mHandler.getLooper().postSyncBarrier();
mChoreographer.postCallback(
Choreographer.CALLBACK_TRAVERSAL, mTraversalRunnable, null);
scheduleConsumeBatchedInput();
}其中mTraversalBarrier = mHandler.getLooper().postSyncBarrier();是设置同步障碍(syncBarrier),当looper中的消息队列执行到barrier 后,会暂停执行,只有当barrier 被释放mHandler.getLooper().removeSyncBarrier(mTraversalBarrier); 后消息队列才能继续执行。
&&& Choreographer mC 是动画系统中的核心组织者, 负责统一调度。后面详细说。
final TraversalRunnable mTraversalRunnable = new TraversalRunnable();
final class TraversalRunnable implements Runnable {
public void run() {
doTraversal();
&&& void doTraversal() {
performTraversals();
perform 待补充
final class ConsumeBatchedInputRunnable implements Runnable {
public void run() {
doConsumeBatchedInput(mChoreographer.getFrameTimeNanos());
final ConsumeBatchedInputRunnable mConsumedBatchedInputRunnable =
new ConsumeBatchedInputRunnable();doConsume 待补充
2 属性动画aninmator
valueAnimator.start();
private void start(boolean playBackwards) {
if (Looper.myLooper() == null) {
throw new AndroidRuntimeException(&Animators may only be run on Looper threads&);
&&&&&&& AnimationHandler animationHandler = getOrCreateAnimationHandler();
&&&&&&& animationHandler.mPendingAnimations.add(this);
&&&&&&& if (mStartDelay == 0) {
&&&&&&&&&&& // This sets the initial value of the animation, prior to actually starting it running
&&&&&&&&&&& setCurrentPlayTime(0);
&&&&&&&&&&& mPlayingState = STOPPED;
&&&&&&&&&&& mRunning =
&&&&&&&&&&& notifyStartListeners();
&&&&&&& animationHandler.start();
这里会检查调用线程必须是Looper线程,如果是view相关的属性动画,还必须是UI 线程。
得到AnimationHandle 并把自己加入到PendingAnimations& 的list中.
getOrCreateAnimationHandler();
protected static ThreadLocal&AnimationHandler& sAnimationHandler =
new ThreadLocal&AnimationHandler&()
protected static class AnimationHandler implements Runnable {
// The per-thread list of all active animations
/** @hide */
protected final ArrayList&ValueAnimator& mAnimations = new ArrayList&ValueAnimator&();
// Used in doAnimationFrame() to avoid concurrent modifications of mAnimations
private final ArrayList&ValueAnimator& mTmpAnimations = new ArrayList&ValueAnimator&();
// The per-thread set of animations to be started on the next animation frame
/** @hide */
protected final ArrayList&ValueAnimator& mPendingAnimations = new ArrayList&ValueAnimator&();
* Internal per-thread collections used to avoid set collisions as animations start and end
* while being processed.
protected final ArrayList&ValueAnimator& mDelayedAnims = new ArrayList&ValueAnimator&();
private final ArrayList&ValueAnimator& mEndingAnims = new ArrayList&ValueAnimator&();
private final ArrayList&ValueAnimator& mReadyAnims = new ArrayList&ValueAnimator&();
private final Choreographer mC
private boolean mAnimationS
AnimationHandler 就是一个runnable, 注意成员变量中的多个animator 的list 以及重要的mChoreographer = Choreographer.getInstance();
mChoreographer 也是一个threadlocal的变量。
在animationHandler.start() 中
public void start() {
scheduleAnimation();
&&&&&&& private void scheduleAnimation() {
&&&&&&&&&&& if (!mAnimationScheduled) {
&&&&&&&&&&&&&&& mChoreographer.postCallback(Choreographer.CALLBACK_ANIMATION, this, null);
&&&&&&&&&&&&&&& mAnimationScheduled =
&&&&&&&&&&& }
this 是runnable 即把animationHandler自己添加添加到mChoreographer 的队列中。
public void postCallback(int callbackType, Runnable action, Object token) {
postCallbackDelayed(callbackType, action, token, 0);
&&& public void postCallbackDelayed(int callbackType,
&&&&&&&&&&& Runnable action, Object token, long delayMillis) {
&&&&&&& postCallbackDelayedInternal(callbackType, action, token, delayMillis);
&&& private void postCallbackDelayedInternal(int callbackType,
&&&&&&&&&&& Object action, Object token, long delayMillis) {
&&&&&&& synchronized (mLock) {
&&&&&&&&&&& final long now = SystemClock.uptimeMillis();
&&&&&&&&&&& final long dueTime = now + delayM
&&&&&&&&&&& mCallbackQueues[callbackType].addCallbackLocked(dueTime, action, token);
&&&&&&&&&&& if (dueTime &= now) {
&&&&&&&&&&&&&&& scheduleFrameLocked(now);
&&&&&&&&&&& } else {
&&&&&&&&&&&&&&& Message msg = mHandler.obtainMessage(MSG_DO_SCHEDULE_CALLBACK, action);
&&&&&&&&&&&&&&& msg.arg1 = callbackT
&&&&&&&&&&&&&&& msg.setAsynchronous(true);
&&&&&&&&&&&&&&& mHandler.sendMessageAtTime(msg, dueTime);
&&&&&&&&&&& }
传入的delay为0, 即调用scheduleFrameLocked(now);
private void scheduleFrameLocked(long now) {
if (!mFrameScheduled) {
mFrameScheduled =
if (USE_VSYNC) {
if (DEBUG) {
Log.d(TAG, &Scheduling next frame on vsync.&);
// If running on the Looper thread, then schedule the vsync immediately,
// otherwise post a message to schedule the vsync from the UI thread
// as soon as possible.
if (isRunningOnLooperThreadLocked()) {
scheduleVsyncLocked();
Message msg = mHandler.obtainMessage(MSG_DO_SCHEDULE_VSYNC);
msg.setAsynchronous(true);
mHandler.sendMessageAtFrontOfQueue(msg);
final long nextFrameTime = Math.max(
mLastFrameTimeNanos / NANOS_PER_MS + sFrameDelay, now);
if (DEBUG) {
Log.d(TAG, &Scheduling next frame in & + (nextFrameTime - now) + & ms.&);
Message msg = mHandler.obtainMessage(MSG_DO_FRAME);
msg.setAsynchronous(true);
mHandler.sendMessageAtTime(msg, nextFrameTime);
private static final boolean USE_VSYNC = SystemProperties.getBoolean(
&debug.choreographer.vsync&, true);USE_VSYNC 默认是true;&&&&
private boolean isRunningOnLooperThreadLocked() {
return Looper.myLooper() == mL
}检查当前looper和mChoreographer的looper是否一致。一般情况是一致的。就会调用scheduleVsyncLocked();
private void scheduleVsyncLocked() {
mDisplayEventReceiver.scheduleVsync();
public void scheduleVsync() {
if (mReceiverPtr == 0) {
Log.w(TAG, &Attempted to schedule a vertical sync pulse but the display event &
+ &receiver has already been disposed.&);
nativeScheduleVsync(mReceiverPtr);
}到了native 暂时先不涉及。
回头来看animationHandler 的run()。 前面提到animationHandler把自己添加到mChoreographer,当被调用时,调用run方法。
// Called by the Choreographer.
public void run() {
mAnimationScheduled =
doAnimationFrame(mChoreographer.getFrameTime());
public long getFrameTime() {
return getFrameTimeNanos() / NANOS_PER_MS;
&&& public long getFrameTimeNanos() {
&&&&&&& synchronized (mLock) {
&&&&&&&&&&& if (!mCallbacksRunning) {
&&&&&&&&&&&&&&& throw new IllegalStateException(&This method must only be called as &
&&&&&&&&&&&&&&&&&&&&&&& + &part of a callback while a frame is in progress.&);
&&&&&&&&&&& }
&&&&&&&&&&& return USE_FRAME_TIME ? mLastFrameTimeNanos : System.nanoTime();
doAnimationFrame()总结就是
1.遍历pending list动画,如果delay为0 则调用start,不为0,加入delay list;
2.遍历delay list, 根据frametime计算是继续delay还是ready可以播放,若是ready,则加入到ready list中;
3 遍历ready list,调用start ;
4,遍历所有animation,根据frametime计算动画是否要结束,如果可以结束,则加入到ending list中;
5,遍历ending list, 调用end;
6, 如果有列表中仍然有动画,则继续scheduleAnimation;
private void doAnimationFrame(long frameTime) {
// mPendingAnimations holds any animations that have requested to be started
// We're going to clear mPendingAnimations, but starting animation may
// cause more to be added to the pending list (for example, if one animation
// starting triggers another starting). So we loop until mPendingAnimations
// is empty.
while (mPendingAnimations.size() & 0) {
ArrayList&ValueAnimator& pendingCopy =
(ArrayList&ValueAnimator&) mPendingAnimations.clone();
mPendingAnimations.clear();
int count = pendingCopy.size();
for (int i = 0; i & ++i) {
ValueAnimator anim = pendingCopy.get(i);
// If the animation has a startDelay, place it on the delayed list
if (anim.mStartDelay == 0) {
anim.startAnimation(this);
mDelayedAnims.add(anim);
// Next, process animations currently sitting on the delayed queue, adding
// them to the active animations if they are ready
int numDelayedAnims = mDelayedAnims.size();
for (int i = 0; i & numDelayedA ++i) {
ValueAnimator anim = mDelayedAnims.get(i);
if (anim.delayedAnimationFrame(frameTime)) {
mReadyAnims.add(anim);
int numReadyAnims = mReadyAnims.size();
if (numReadyAnims & 0) {
for (int i = 0; i & numReadyA ++i) {
ValueAnimator anim = mReadyAnims.get(i);
anim.startAnimation(this);
anim.mRunning =
mDelayedAnims.remove(anim);
mReadyAnims.clear();
// Now process all active animations. The return value from animationFrame()
// tells the handler whether it should now be ended
int numAnims = mAnimations.size();
for (int i = 0; i & numA ++i) {
mTmpAnimations.add(mAnimations.get(i));
for (int i = 0; i & numA ++i) {
ValueAnimator anim = mTmpAnimations.get(i);
if (mAnimations.contains(anim) && anim.doAnimationFrame(frameTime)) {
mEndingAnims.add(anim);
mTmpAnimations.clear();
if (mEndingAnims.size() & 0) {
for (int i = 0; i & mEndingAnims.size(); ++i) {
mEndingAnims.get(i).endAnimation(this);
mEndingAnims.clear();
// If there are still active or delayed animations, schedule a future call to
// onAnimate to process the next frame of the animations.
if (!mAnimations.isEmpty() || !mDelayedAnims.isEmpty()) {
scheduleAnimation();
在animationFrame() 中根据当前状态,并且计算fraction,调用animateValue();
boolean animationFrame(long currentTime) {
&&&&&&& boolean done =
&&&&&&& switch (mPlayingState) {
&&&&&&& case RUNNING:
&&&&&&& case SEEKED:
//省略计算fraction的代码
&&&&&&&&&&& animateValue(fraction);
&&&&&&&&&&&
通过mInterpolator.getInterpolation计算fraction;@Interpolator&
根据fraction计算内部所有value,如果有updateListener,调用之。
void animateValue(float fraction) {
fraction = mInterpolator.getInterpolation(fraction);
mCurrentFraction =
int numValues = mValues.
for (int i = 0; i & numV ++i) {
mValues[i].calculateValue(fraction);
if (mUpdateListeners != null) {
int numListeners = mUpdateListeners.size();
for (int i = 0; i & numL ++i) {
mUpdateListeners.get(i).onAnimationUpdate(this);
3. 插值器
从上面的介绍可以看到,Interpolator的关键是getInterpolation();
在ValueAnimator.animationFrame()中可以看到, 传递给Interpolator 的fraction是在[0,1] 值域范围。
float fraction = mDuration & 0 ? (float)(currentTime - mStartTime) / mDuration : 1f;
if (fraction &= 1f) {
if (mCurrentIteration & mRepeatCount || mRepeatCount == INFINITE) {
// Time to repeat
if (mListeners != null) {
int numListeners = mListeners.size();
for (int i = 0; i & numL ++i) {
mListeners.get(i).onAnimationRepeat(this);
if (mRepeatMode == REVERSE) {
mPlayingBackwards = !mPlayingB
mCurrentIteration += (int)
fraction = fraction % 1f;
mStartTime += mD
fraction = Math.min(fraction, 1.0f);
if (mPlayingBackwards) {
fraction = 1f -
所以设计Interpolator 就是设计一个输入[0,1] 的函数。
先参观一下系统的几个Interpolator。
3.1 AccelerateDecelerateInterpolator
cos(t+1)Pi /2 +0.5f
从图可以看到,先加速后减速,病最终到达结束位置。
public class AccelerateDecelerateInterpolator implements Interpolator {
public float getInterpolation(float input) {
return (float)(Math.cos((input + 1) * Math.PI) / 2.0f) + 0.5f;
3.2 AccelerateInterpolator
如果factor=1 则函数为x^2
否则函数为x^a (a 是参数)
默认函数式x^2
如图示,逐渐加速到结束位置。
public class AccelerateInterpolator implements Interpolator {
private final float mF
private final double mDoubleF
public AccelerateInterpolator() {
mFactor = 1.0f;
mDoubleFactor = 2.0;
* Constructor
* @param factor Degree to which the animation should be eased. Seting
factor to 1.0f produces a y=x^2 parabola. Increasing factor above
exaggerates the ease-in effect (i.e., it starts even
slower and ends evens faster)
public AccelerateInterpolator(float factor) {
mDoubleFactor = 2 * mF
public float getInterpolation(float input) {
if (mFactor == 1.0f) {
return input *
return (float)Math.pow(input, mDoubleFactor);
3.3 LinearInterpolator
线性的就是Y=X 没啥说的。
public class LinearInterpolator implements Interpolator {
public float getInterpolation(float input) {
3.4 anticipateInterpolator&&
函数是:x^2((a+1)x-a) 默认参数a=2 默认函数为x^2(3x-1)
如图示, 会先反方向执行一段,然后正向一直加速至结束位置。
public class AnticipateInterpolator implements Interpolator {
private final float mT
public AnticipateInterpolator() {
mTension = 2.0f;
* @param tension Amount of anticipation. When tension equals 0.0f, there is
no anticipation and the interpolator becomes a simple
acceleration interpolator.
public AnticipateInterpolator(float tension) {
mTension =
public float getInterpolation(float t) {
// a(t) = t * t * ((tension + 1) * t - tension)
return t * t * ((mTension + 1) * t - mTension);
3.5 aniticipateOvershoot
是一个分段函数,默认参数a=3
2x*x[(2x*(a+1)-a)]&&&& 0&=x&=0.5
2(x-1)(x-1)[(2x-1)(a+1)+a]&&& 0.5&x&=1
通过下图可以看到,动画会先反方向执行,然后向正方向逐渐加速,在快结束时逐渐减速,并超过预设的值,最后回到结束位置。
2x*x[(2x*(a+1)-a)]&&&& 0&=x&=0.5 的函数图
2(x-1)(x-1)[(2x-1)(a+1)+a]&&& 0.5&x&=1的函数图
public class AnticipateOvershootInterpolator implements Interpolator {
private final float mT
public AnticipateOvershootInterpolator() {
mTension = 2.0f * 1.5f;
* @param tension Amount of anticipation/overshoot. When tension equals 0.0f,
there is no anticipation/overshoot and the interpolator becomes
a simple acceleration/deceleration interpolator.
public AnticipateOvershootInterpolator(float tension) {
mTension = tension * 1.5f;
* @param tension Amount of anticipation/overshoot. When tension equals 0.0f,
there is no anticipation/overshoot and the interpolator becomes
a simple acceleration/deceleration interpolator.
* @param extraTension Amount by which to multiply the tension. For instance,
to get the same overshoot as an OvershootInterpolator with
a tension of 2.0f, you would use an extraTension of 1.5f.
public AnticipateOvershootInterpolator(float tension, float extraTension) {
mTension = tension * extraT
private static float a(float t, float s) {
return t * t * ((s + 1) * t - s);
private static float o(float t, float s) {
return t * t * ((s + 1) * t + s);
public float getInterpolation(float t) {
// a(t, s) = t * t * ((s + 1) * t - s)
// o(t, s) = t * t * ((s + 1) * t + s)
// f(t) = 0.5 * a(t * 2, tension * extraTension), when t & 0.5
// f(t) = 0.5 * (o(t * 2 - 2, tension * extraTension) + 2), when t &= 1.0
if (t & 0.5f) return 0.5f * a(t * 2.0f, mTension);
else return 0.5f * (o(t * 2.0f - 2.0f, mTension) + 2.0f);
4. 指导设计动画。
从第3节中可以看到,想要让动画按照我们预期的行为来执行,需要做的就是找到合适的函数。
画图使用/在线工具
本文已收录于以下专栏:
相关文章推荐
ScheduledThreadPoolExecutor执行停止问题&Android几个动画回调运行线程
设置一个动画播放这一观点。如果你想立即播放的动画,使用startAnimation这种方法提供了允许细粒度控制的起始时间和失效,
但你必须确保:1)动画开始时间 2)动画应该开始时的观点,将被视为无...
转载请标明出处:http://blog.csdn.net/lmj/article/details/,本文出自:【张鸿洋的博客】1、概述Android中想做很炫酷的动画...
一、 LayoutAnimation
LayoutAnimation 是API Level 1 就已经有的,LayoutAnimation是对于ViewGroup控件所有的child view的操作,...
自己处理ANR问题单的一点经验,希望能对大家有帮助。
深入分析UI 上层事件处理核心机制 Choreographer
结论写在前面:Choreographer就是一个消息处理器,根据vsync 信号 来计算frame,而计算frame的方式就是处理三种...
仿MIUI toast 动画效果实现
本文中涉及两个点比较重要:一是设计一个OvershootInterpolator,并使用开源库实现的动画效果;二是使用自定义的layout ,并通过Window...
通过第一篇文章,大家明白了调用native方法之前,首先要调用System.loadLibrary接口加载一个实现了native方法的动态库才能正常访问,否则就会抛出java.lang.Unsatis...
Android Project Butter分析一背景知识介绍随着时间的推移,Android OS系统一直在不断进化、壮大,日趋完善。但直到Android 4.0问世,有关UI显示不流畅的问题也一直未...
转载请标明出处:http://blog.csdn.net/lmj/article/details/,本文出自:【张鸿洋的博客】1、概述今天打开建行看存款,一看伤心欲绝...
他的最新文章
讲师:汪剑
讲师:刘道宽
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)Unity API——Application类的详解(一):列举属性和方法 - 简书
Unity API——Application类的详解(一):列举属性和方法
  Application类位于UnityEngine下,用于访问应用程序在运行时的一些数据。这个类不包含实例属性和实例方法,这就意味着在脚本中我们直接通过Application类来调用其静态的属性静态方法来控制程序运行时的数据。
为了更好的了解这个类,下面列举了Unity官网提供的静态属性和静态方法
静态属性(Static Variables)
string dataPath
Contains the path to the game data folder (Read Only).
游戏数据路径
string persistentDataPath
Contains the path to a persistent data directory (Read Only).
持久化数据路径。
streamingAssetsPath
Contains the path to the StreamingAssets folder (Read Only).
流数据缓存目录。
string temporaryCachePath
Contains the path to a temporary data / cache directory (Read Only).
零时缓存目录。
int levelCount
The total number of levels available (Read Only).
场景的总数。
loadedLevel
The level index that was last loaded (Read Only).
当前加载的场景序号
int loadedLevelName
The name of the level that was last loaded (Read Only).
当前加载的场景名称。
bool isLoadingLevel
Is some level being loaded? (Read Only). isLoadingLevel returns true if a level load was requested this frame already.
 表示当前加载的场景是否还需要当前帧。
NetworkReachability internetReachability
Returns the type of Internet reachability currently possible on the device.
 表示当前设备的网络连接方式。
RuntimePlatform platform
Returns the platform the game is running (Read Only).
表示当前游戏运行的平台。
bool isConsolePlatform
Is the current Runtime platform a known console platform.
  表示当前运行的平台是否为控制台。
bool isMobilePlatform
Is the current Runtime platform a known mobile platform.
 当前运行的平台是否为移动平台。
bool isWebPlayer
Are we running inside a web player? (Read Only).
当前运行的平台是否为web平台。
bool isEditor
Are we running inside the Unity editor? (Read Only).
 表示当前是否在Unity编辑器环境中运行程序。
int targetFrameRate
Instructs game to try to render at a specified frame rate.
ThreadPriority backgroundLoadingPriority
Priority of background loading thread.
表示后台加载优先级。
string bundleIdentifier
eturns application bundle identifier at runtime.
表示应用运行时的标识符。
string cloudProjectId
A unique cloud project identifier. It is unique for every project (Read Only).
云应用的唯一标识符。
string companyName
Return application company name (Read Only).
应用的公司名称。
ApplicationInstallMode installMode
Returns application install mode (Read Only).
应用安装模式。
bool runInBackground
Should the player be running when the application is in the background?
应用是否在后台运行。
ApplicationSandboxType sandboxType
Returns application running in sandbox (Read Only).
应用程序运行的沙箱类型。
string srcValue
The path to the web player data file relative to the html file (Read Only).
 web player 文件的路径。
streamedBytes
 How many bytes have we downloaded from the main unity web stream (Read Only).
 字节流数。
SystemLanguage systemLanguage
How many bytes have we downloaded from the main unity web stream (Read Only).
当前系统使用的语言。
string unityVersion
The version of the Unity runtime used to play the content.
Unity的版本。
string version
Returns application version number (Read Only).
应用版本。
int webSecurityEnabled
Indicates whether Unity's webplayer security model is enabled.
unity 的webplayer的安全模式是否开启。
string absoluteURL
The absolute path to the web player data file (Read Only).
用于保存在web浏览器中数据文件的绝对路径。
bool genuine
Returns false if application is altered in any way after it was built.
bool genuineCheckAvailable
Contains the path to the game data folder (Read Only).
ApplicationInstallMode installMode
 Returns application install mode (Read Only).
 应用安装模式。
静态方法(Static Functions)
void LoadLevel(int index);
void LoadLevel(string name);
 Loads the level by its name or index.
根据场景名称和索引号加载场景
void LoadLevelAdditive(int index);void LoadLevelAdditive(string name);
 Loads a level additively.
根据场景名称和索引号加载场景,但是当前场景的物体不销毁
AsyncOperation LoadLevelAsync(int index); AsyncOperation LoadLevelAsync(string levelName);
Loads the level asynchronously in the background.
异步加载场景
AsyncOperation LoadLevelAdditiveAsync(int index); AsyncOperation
LoadLevelAdditiveAsync(string levelName);
Loads the level additively and asynchronously in the background.
异步加载场景,而且当前物体不销毁
void Quit();
Quits the player application.
void CancelQuit();
Cancels quitting the application. This is useful for showing a splash screen at the end of a game.
取消应用退出。
bool CanStreamedLevelBeLoaded(int levelIndex);
Can the streamed level be loaded?
获得当前levelindex的场景是否被加载。
void CaptureScreenshot(string filename, int superSize = 0);
Captures a screenshot at path filename as a PNG file.
void OpenURL(string url);
Opens the url in a browser.
在浏览器中访问网址
AsyncOperation RequestUserAuthorization(UserAuthorization mode);
Request authorization to use the webcam or microphone in the Web Player.
请求获得权限
void ExternalCall(string functionName, params object[] args);
alls a function in the containing web page (Web Player only).
在webplayer 调用一个javaScrip函数。
void ExternalEval(string script);
Evaluates script snippet in the containing web page (Web Player only).
在webplayer上执行javascrip片段。
float GetStreamProgressForLevel(int levelIndex);
How far has the download progressed? [0...1].
下载进度。
bool HasUserAuthorization(mode);
pCheck if the user has authorized use of the webcam or microphone in the Web Player.
检测用户是否有webcam和手机在webpalyer的权限。
  虽然以上罗列的属性和方法官网API都有详细的介绍,但这里我用表格的形式展现出这些方法和属性,阅读起来更直观,同时我将常用的放在前面,功能相似的属性和方法放在一块,这样好做一个区分和比较。  第一篇文章就这样写完了,虽然没有写什么实质性的内容,但还是感觉蛮有成就感的,最重要的是已经迈出了第一步,敢写敢做,立马行动,以前知道写博客文章很重要,但是迟迟没有行动,所以说路在脚下,要敢于往前走。还有就是学会了使用markdown,一开始用的时候感觉挺不适应的,但慢慢写下来,熟悉了语法,觉得还是挺好用的,好处不用说,谁用谁知道。  今天只是一个开始,坚持!继续加油!
-&更新深圳young}

我要回帖

更多关于 read only 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信