|
@@ -1,6 +1,8 @@
|
|
|
using UnityEngine;
|
|
|
using System.Collections;
|
|
|
using System;
|
|
|
+using UnityEditor;
|
|
|
+
|
|
|
namespace GFGGame
|
|
|
{
|
|
|
public class SceneController
|
|
@@ -74,7 +76,8 @@ namespace GFGGame
|
|
|
Sprite sp = GFGAsset.Load<Sprite>(resPath);
|
|
|
spr.sprite = sp;
|
|
|
spr.size = spr.sprite.bounds.size;//将节点设置为原图大小
|
|
|
-
|
|
|
+ // TextureImporter ti = (TextureImporter)TextureImporter.GetAtPath(AssetDatabase.GetAssetPath(spr));
|
|
|
+ // ti.isReadable = true;
|
|
|
|
|
|
if (type == EnumPhotographType.BG)
|
|
|
{
|
|
@@ -88,12 +91,15 @@ namespace GFGGame
|
|
|
}
|
|
|
public static void PhotographAddCollider(GameObject gameObject)
|
|
|
{
|
|
|
- if (gameObject.GetComponent<PolygonCollider2D>() == null)
|
|
|
+ PolygonCollider2D polygonCollider2D = gameObject.GetComponent<PolygonCollider2D>();
|
|
|
+ if (polygonCollider2D != null)
|
|
|
{
|
|
|
- gameObject.AddComponent<PolygonCollider2D>();
|
|
|
- gameObject.GetComponent<PolygonCollider2D>().isTrigger = true;
|
|
|
- gameObject.GetComponent<PolygonCollider2D>().autoTiling = true;
|
|
|
+ GameObject.Destroy(polygonCollider2D);
|
|
|
}
|
|
|
+
|
|
|
+ polygonCollider2D = gameObject.AddComponent<PolygonCollider2D>();
|
|
|
+ polygonCollider2D.isTrigger = true;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public static void UpdateRole(int[] equipDatas, GameObject sceneObj, bool needSetMask = false, int[] exceptTypes = null, bool showAni = true, GameObject parentObj = null)
|