示例#1
0
 public void initModelAsync(string modelPath, OnCharacterLoaded callback, object userData, string animationControllerPath = null)
 {
     mModelPath = modelPath;
     mAnimationControllerPath = animationControllerPath;
     mCharacterLoadedCallback = callback;
     mUserData = userData;
     if (!isEmpty(modelPath))
     {
         // 模型节点也就是角色节点,并且将节点挂到角色管理器下
         mObjectPool.createObjectAsync(mModelPath, onModelLoaded, mModelTag, null);
     }
 }
示例#2
0
 public void initModel(string modelPath, string animationControllerPath = null)
 {
     mModelPath = modelPath;
     mAnimationControllerPath = animationControllerPath;
     mCharacterLoadedCallback = null;
     mUserData = null;
     if (!isEmpty(modelPath))
     {
         // 模型节点也就是角色节点,并且将节点挂到角色管理器下
         onModelLoaded(mObjectPool.createObject(mModelPath, mModelTag), null);
         afterModelLoaded();
     }
 }
示例#3
0
 public override void resetProperty()
 {
     base.resetProperty();
     mBaseData     = null;
     mAvatar       = null;
     mRigidBody    = null;
     mStateMachine = null;
     mDecisionTree = null;
     mGUID         = 0;
     mAnimationLenghtList.Clear();
     mCharacterType           = null;
     mCharacterLoadedCallback = null;
     mModelPath = null;
     mAnimationControllerPath = null;
     mUserData = null;
     mModelTag = 0;
     // mModelLoadCallback不重置
     // mModelLoadCallback = null;
 }
示例#4
0
 protected void afterModelLoaded()
 {
     mCharacterLoadedCallback?.Invoke(this, mUserData);
     mCharacterLoadedCallback = null;
     mUserData = null;
 }