• 大小: 5.23MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-11
  • 语言: 其他
  • 标签: U3D  C4D  

资源简介

一款C4DtoUnity的中间件工具。支持顶点动画,脚本,Shader链接等,整合你的工作流

资源截图

代码片段和文件信息

using UnityEditor;
using UnityEngine;

using System;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;


namespace Hont.C2UTool
{
    public static class C2UAnalyzer
    {
        static C2UStructs mContext;


        public static void BuildFromStruct(C2UStructs context)
        {
            var oriTime = EditorApplication.timeSinceStartup;

            mContext = context;

            CreatelinkInfoFile(mContext);
            ApplyFBXModelImporterModify(mContext);

            mContext.ContextInfo.AnimationClip = SplitAnimationClip(mContext);

            ReplacePathPrefix(context);

            ApplyAnimationClipOperation(mContext);
            ApplyAnimationCurve(mContext);
            ApplyAttachAnimation(mContext);
            ApplyMaterialInfo(mContext);
            ApplyStaticAttachInfo(mContext);

            ApplyOutputAvatarInfo(mContext);

            SavePrefab(mContext);

            AssetDatabase.SaveAssets();

            C2UUtility.ApplyChangedAnimationClip();
            ApplyAttachOutputPath(mContext);

            AssetDatabase.Refresh();

            var timeSub = new TimeSpan(0 0 Convert.ToInt32((EditorApplication.timeSinceStartup - oriTime)));
            EditorUtility.DisplayDialog(“Tip“ string.Format(“[{0:mm:ss}]Analyze Completed!“ timeSub) “OK“);
        }

        public static C2UStructs InitContext(string attachInfo)
        {
            var result = new C2UStructs();

            #region ---Sub Component Initiation---
            result.SubComponentInfo = new C2UStructs.SubComponentStruct();

            var animationInfoAnalyzersArr = C2UUtility
                .GetAssemblyInterfacesAndCreate(System.Reflection.Assembly.Load(“Assembly-CSharp-Editor“));

            Array.Sort(animationInfoAnalyzersArr (x y) => -x.Priority.CompareTo(y.Priority));

            var staticInfoAnalyzersArr = C2UUtility
                .GetAssemblyInterfacesAndCreate(System.Reflection.Assembly.Load(“Assembly-CSharp-Editor“));

            Array.Sort(staticInfoAnalyzersArr (x y) => -x.Priority.CompareTo(y.Priority));

            result.SubComponentInfo.AnimationInfoAnalyzersArr = animationInfoAnalyzersArr;
            result.SubComponentInfo.StaticInfoAnalyzersArr = staticInfoAnalyzersArr;
            #endregion

            #region ---Analyze StringInitiation---
            var lv1Categorys = attachInfo.Split(‘|‘);
            //The outest categorythrough ‘|‘ symbol split the contents.
            //Index 0 - base Info(fbx pathis loop animationetc)
            //Index 1 - Attach Animation Info(script animation active animation etc)
            //Index 2 - Animation Event Info
            //Index 3 - Animation Curve Info
            //Index 4 - Static Info(component replace custom scriptcamera etc)
            //Index 5 - Material Info(material and shader)

            result.baseInfo = AnalyzebaseInfo(lv1Cat

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-09-27 11:36  C2UTool\
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAbout\
     文件         842  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAbout\C4D2UnitySuiteAbout.pyp
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAbout\res\
     文件          86  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAbout\res\c4d_symbols.h
     文件        2152  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAbout\res\tag.png
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\
     文件         675  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\AnimationEventTag.pyp
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\res\
     文件          61  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\res\c4d_symbols.h
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\res\description\
     文件         171  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\res\description\animationeventtag.h
     文件         274  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\res\description\animationeventtag.res
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\res\strings_us\
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\res\strings_us\description\
     文件         252  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\res\strings_us\description\animationeventtag.str
     文件        2631  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteAnimationEventTag\res\tag.png
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\
     文件        7373  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\C2UShaderConnecter.pyp
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\res\
     文件          61  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\res\c4d_symbols.h
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\res\description\
     文件         188  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\res\description\c2u_shader_connect.h
     文件         327  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\res\description\c2u_shader_connect.res
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\res\strings_us\
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\res\strings_us\description\
     文件         243  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteShaderConnecter\res\strings_us\description\c2u_shader_connect.str
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteUnityActiveTag\
     文件         890  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteUnityActiveTag\UnityActiveTag.pyp
     目录           0  2017-09-27 11:36  C2UTool\C4D-C4D2UnitySuite\C4D2UnitySuiteUnityActiveTag\res\
............此处省略165个文件信息

评论

共有 条评论