//------------------------------------------------------------------------------------------------------------------
    protected void onKeyFrameLoaded(UnityEngine.Object asset, UnityEngine.Object[] subAsset, byte[] bytes, object userData, string loadPath)
    {
        GameObject keyFrameObject = instantiatePrefab(mObject, asset as GameObject, true);
        // 查找关键帧曲线,加入列表中
        GameKeyframe gameKeyframe = keyFrameObject.GetComponent <GameKeyframe>();

        if (gameKeyframe == null)
        {
            logError("object in KeyFrame folder must has GameKeyframe Component!");
            return;
        }
        AnimationCurve animCurve = gameKeyframe.mCurve;

        if (animCurve != null)
        {
            Curve curve = new Curve();
            curve.mObject = keyFrameObject;
            curve.mCurve  = animCurve;
            mCurveList[asset.name.ToLower()] = curve;
            ++mLoadedCount;
            // 加载完所有关键帧后,卸载所有关键帧预设
            if (isLoadDone())
            {
                mResourceManager.unloadPath(CommonDefine.R_KEY_FRAME_PATH);
            }
        }
        else
        {
            logError("object in KeyFrame folder must has AnimationCurve!");
        }
    }
Beispiel #2
0
    protected void DrawCommonProperties()
    {
        GameKeyframe keyframe = target as GameKeyframe;

        BeginContents();
        GUI.changed = false;
        EditorGUILayout.CurveField("Curve", keyframe.mCurve, GUILayout.Width(170f), GUILayout.Height(62f));
        EndContents();
    }