|
@@ -369,18 +369,16 @@ namespace GFGGame
|
|
private static GameObject AddAnimationObj(string res, string objName, GameObject parentObj, int sortingOrder)
|
|
private static GameObject AddAnimationObj(string res, string objName, GameObject parentObj, int sortingOrder)
|
|
{
|
|
{
|
|
string resPath = ResPathUtil.GetDressUpAnimationPath(res);
|
|
string resPath = ResPathUtil.GetDressUpAnimationPath(res);
|
|
- if (!VEngine.Versions.Contains(resPath))
|
|
|
|
- {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
var gameObj = GetGameObjExisted(parentObj, objName, resPath);
|
|
var gameObj = GetGameObjExisted(parentObj, objName, resPath);
|
|
if (gameObj != null)
|
|
if (gameObj != null)
|
|
{
|
|
{
|
|
return gameObj;
|
|
return gameObj;
|
|
}
|
|
}
|
|
- var prefab = GFGAsset.Load<GameObject>(resPath);
|
|
|
|
- gameObj = GameObject.Instantiate(prefab);
|
|
|
|
- AddAssetReleaser(gameObj, resPath);
|
|
|
|
|
|
+ gameObj = CreateAnimationObj(resPath);
|
|
|
|
+ if(gameObj == null)
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
if (objName == BODY_ANIMATION_NAME)
|
|
if (objName == BODY_ANIMATION_NAME)
|
|
{
|
|
{
|
|
//如果是动作动画,就根据动画位置及角度信息设置给Role对象
|
|
//如果是动作动画,就根据动画位置及角度信息设置给Role对象
|
|
@@ -409,18 +407,16 @@ namespace GFGGame
|
|
private static GameObject TryAddEffectObj(string res, string objName, GameObject parentObj, int sortingOrder, bool inAniDir)
|
|
private static GameObject TryAddEffectObj(string res, string objName, GameObject parentObj, int sortingOrder, bool inAniDir)
|
|
{
|
|
{
|
|
var resPath = ResPathUtil.GetDressUpEffectPath(res, inAniDir);
|
|
var resPath = ResPathUtil.GetDressUpEffectPath(res, inAniDir);
|
|
- if (!VEngine.Versions.Contains(resPath))
|
|
|
|
- {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
var gameObj = GetGameObjExisted(parentObj, objName, resPath);
|
|
var gameObj = GetGameObjExisted(parentObj, objName, resPath);
|
|
if (gameObj != null)
|
|
if (gameObj != null)
|
|
{
|
|
{
|
|
return gameObj;
|
|
return gameObj;
|
|
}
|
|
}
|
|
- GameObject effPre = GFGAsset.Load<GameObject>(resPath);
|
|
|
|
- gameObj = GameObject.Instantiate(effPre);
|
|
|
|
- AddAssetReleaser(gameObj, resPath);
|
|
|
|
|
|
+ gameObj = CreateAnimationObj(resPath);
|
|
|
|
+ if (gameObj == null)
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
gameObj.transform.SetParent(parentObj.transform, false);
|
|
gameObj.transform.SetParent(parentObj.transform, false);
|
|
gameObj.name = objName;
|
|
gameObj.name = objName;
|
|
var sortingGroup = gameObj.transform.GetComponent<SortingGroup>();
|
|
var sortingGroup = gameObj.transform.GetComponent<SortingGroup>();
|
|
@@ -479,12 +475,11 @@ namespace GFGGame
|
|
|
|
|
|
public static GameObject CreateAnimationObj(string resPath)
|
|
public static GameObject CreateAnimationObj(string resPath)
|
|
{
|
|
{
|
|
- // string resPath = ResPathUtil.GetCardAnimationPath(res);
|
|
|
|
- var prefab = GFGAsset.Load<GameObject>(resPath);
|
|
|
|
- if (prefab == null)
|
|
|
|
|
|
+ if (!VEngine.Versions.Contains(resPath))
|
|
{
|
|
{
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+ var prefab = GFGAsset.Load<GameObject>(resPath);
|
|
var gameObj = GameObject.Instantiate(prefab);
|
|
var gameObj = GameObject.Instantiate(prefab);
|
|
AddAssetReleaser(gameObj, resPath);
|
|
AddAssetReleaser(gameObj, resPath);
|
|
return gameObj;
|
|
return gameObj;
|