Merge branch 'master_develop' of http://60.1.1.230/gaoxin/JL_Client into master_develop
commit
ce6c8c7871
|
@ -109,8 +109,13 @@ function this.StateChange(isOpen)
|
||||||
this.btnRecord:SetActive(isOpen and isJoin)
|
this.btnRecord:SetActive(isOpen and isJoin)
|
||||||
this.btnTeamRank:SetActive(isOpen and isJoin)
|
this.btnTeamRank:SetActive(isOpen and isJoin)
|
||||||
this.btnFightDetail:SetActive(isOpen and isJoin and baseData.battleState == TOP_MATCH_TIME_STATE.OPEN_IN_END)
|
this.btnFightDetail:SetActive(isOpen and isJoin and baseData.battleState == TOP_MATCH_TIME_STATE.OPEN_IN_END)
|
||||||
this.orggroup:SetActive(not isOpen and not isOver)
|
-- this.orggroup:SetActive(not isOpen and not isOver)
|
||||||
this.Demons:SetActive(not isOpen and not isOver)
|
-- this.Demons:SetActive(not isOpen and not isOver)
|
||||||
|
this.orggroup:SetActive(not isOpen or (isOpen and isOver))
|
||||||
|
this.Demons:SetActive(not isOpen or (isOpen and isOver))
|
||||||
|
if not isOpen or (isOpen and isOver) then
|
||||||
|
this.FreshTeam()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--被动技能表
|
--被动技能表
|
||||||
local passivityList = {
|
local passivityList = {
|
||||||
--发动技能时,[a]的概率将[b]*[c]算作[d]计算
|
--发动技能时,[a]的概率将[b]*[c]算作[d]计算
|
||||||
|
@ -1562,7 +1563,7 @@ local passivityList = {
|
||||||
-- buff.cover = true -- 可以叠加
|
-- buff.cover = true -- 可以叠加
|
||||||
-- buff.clear = false -- 不可驱散
|
-- buff.clear = false -- 不可驱散
|
||||||
-- role:AddBuff(buff)
|
-- role:AddBuff(buff)
|
||||||
if skill and not skill.isAdd and defRole:IsDead() then
|
if skill and not skill.isAdd and defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then
|
||||||
role:AddRage(i1, CountTypeName.Add)
|
role:AddRage(i1, CountTypeName.Add)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1780,7 +1781,7 @@ local passivityList = {
|
||||||
local ct = args[3]
|
local ct = args[3]
|
||||||
-- 释放技能后
|
-- 释放技能后
|
||||||
local onRoleHit = function(defRole)
|
local onRoleHit = function(defRole)
|
||||||
if defRole:IsDead() then
|
if defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then
|
||||||
local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct)
|
local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct)
|
||||||
-- buff.cover = true
|
-- buff.cover = true
|
||||||
role:AddBuff(buff)
|
role:AddBuff(buff)
|
||||||
|
@ -1984,7 +1985,8 @@ local passivityList = {
|
||||||
local i1 = args[1]
|
local i1 = args[1]
|
||||||
-- 释放技能后
|
-- 释放技能后
|
||||||
local onRoleHit = function(target)
|
local onRoleHit = function(target)
|
||||||
if target:IsDead() and BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false then
|
LogError("target "..target.roleId .. " ".. target.star)
|
||||||
|
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
|
||||||
for i = 1, i1 do
|
for i = 1, i1 do
|
||||||
role:AddSkill(BattleSkillType.Normal, false, true, nil)
|
role:AddSkill(BattleSkillType.Normal, false, true, nil)
|
||||||
end
|
end
|
||||||
|
@ -2030,7 +2032,7 @@ local passivityList = {
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
-- 释放技能后
|
-- 释放技能后
|
||||||
local onRoleHit = function(target)
|
local onRoleHit = function(target)
|
||||||
if target:IsDead() then
|
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
|
||||||
local treat = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.MaxHp), f1))
|
local treat = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.MaxHp), f1))
|
||||||
BattleUtil.CalTreat(role, role, treat)
|
BattleUtil.CalTreat(role, role, treat)
|
||||||
end
|
end
|
||||||
|
@ -2219,7 +2221,7 @@ local passivityList = {
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
-- 释放技能后
|
-- 释放技能后
|
||||||
local onRoleHit = function(target)
|
local onRoleHit = function(target)
|
||||||
if target:IsDead() then
|
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
|
||||||
local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add)
|
local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add)
|
||||||
role:AddBuff(buff)
|
role:AddBuff(buff)
|
||||||
end
|
end
|
||||||
|
@ -2374,7 +2376,7 @@ local passivityList = {
|
||||||
|
|
||||||
-- 击杀数量累加
|
-- 击杀数量累加
|
||||||
local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
|
local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
|
||||||
if skill and defRole:IsDead() then
|
if skill and defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then
|
||||||
killNum = killNum + 1
|
killNum = killNum + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2753,7 +2755,7 @@ local passivityList = {
|
||||||
local dot = args[1]
|
local dot = args[1]
|
||||||
local f1 = args[2]
|
local f1 = args[2]
|
||||||
local function onHit(target)
|
local function onHit(target)
|
||||||
if target:IsDead() then
|
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
|
||||||
local maxHp = role:GetRoleData(RoleDataName.MaxHp)
|
local maxHp = role:GetRoleData(RoleDataName.MaxHp)
|
||||||
local value = floor(BattleUtil.ErrorCorrection(maxHp* f1))
|
local value = floor(BattleUtil.ErrorCorrection(maxHp* f1))
|
||||||
BattleUtil.ApplyTreat(role, role, value)
|
BattleUtil.ApplyTreat(role, role, value)
|
||||||
|
@ -2888,7 +2890,7 @@ local passivityList = {
|
||||||
local i1 = args[1]
|
local i1 = args[1]
|
||||||
|
|
||||||
local onHit = function(target, damage, bCrit, finalDmg)
|
local onHit = function(target, damage, bCrit, finalDmg)
|
||||||
if target:IsDead() then
|
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
|
||||||
role:AddRage(i1, CountTypeName.Add)
|
role:AddRage(i1, CountTypeName.Add)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -3209,7 +3211,7 @@ local passivityList = {
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
-- 直接伤害后
|
-- 直接伤害后
|
||||||
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
|
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
|
||||||
if skill and not skill.isAdd and target:IsDead() then
|
if skill and not skill.isAdd and target:IsDead() and BattleUtil.CheckIsNoDead(target) then
|
||||||
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
|
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
|
||||||
BattleUtil.SortByHpFactor(list, 1)
|
BattleUtil.SortByHpFactor(list, 1)
|
||||||
local index = 0
|
local index = 0
|
||||||
|
@ -3483,7 +3485,7 @@ local passivityList = {
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
|
|
||||||
local onRoleHit = function(target)
|
local onRoleHit = function(target)
|
||||||
if target:IsDead() then
|
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
|
||||||
local target = RoleManager.GetAliveAggro(role)
|
local target = RoleManager.GetAliveAggro(role)
|
||||||
BattleUtil.CalDamage(nil, role, target, 1, f1)
|
BattleUtil.CalDamage(nil, role, target, 1, f1)
|
||||||
end
|
end
|
||||||
|
@ -3767,7 +3769,7 @@ local passivityList = {
|
||||||
[197] = function(role, args)
|
[197] = function(role, args)
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
|
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
|
||||||
if skill and skill.type == BattleSkillType.Special and target:IsDead() then
|
if skill and skill.type == BattleSkillType.Special and target:IsDead() and BattleUtil.CheckIsNoDead(target) then
|
||||||
BattleUtil.RandomAction(f1, function()
|
BattleUtil.RandomAction(f1, function()
|
||||||
role:AddRage(target.Rage, CountTypeName.Add)
|
role:AddRage(target.Rage, CountTypeName.Add)
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -341,6 +341,17 @@ function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageTy
|
||||||
return BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType)
|
return BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--检测是否有是金翅大鹏有不灭效果
|
||||||
|
function BattleUtil.CheckIsNoDead(target)
|
||||||
|
if target then
|
||||||
|
return target:IsAssignHeroAndHeroStar(10086,10)==false and BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType)
|
function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType)
|
||||||
if damage < 0 then damage = 0 end
|
if damage < 0 then damage = 0 end
|
||||||
local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage)
|
local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage)
|
||||||
|
|
|
@ -27,7 +27,7 @@ function RoleLogic:Init(uid, data, position)
|
||||||
self.uid = uid
|
self.uid = uid
|
||||||
self.position = position
|
self.position = position
|
||||||
self.roleData = data
|
self.roleData = data
|
||||||
|
self.roleId=data.roleId
|
||||||
self.data:Init(self, data.property)
|
self.data:Init(self, data.property)
|
||||||
self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0
|
self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0
|
||||||
self.isRealDead = self.isDead
|
self.isRealDead = self.isDead
|
||||||
|
@ -37,7 +37,7 @@ function RoleLogic:Init(uid, data, position)
|
||||||
self.element = data.element
|
self.element = data.element
|
||||||
self.professionId = data.professionId
|
self.professionId = data.professionId
|
||||||
self.star = data.star or 1
|
self.star = data.star or 1
|
||||||
|
LogError("英雄uid".. self.roleId .." " .. self.star)
|
||||||
self.shield:Clear() --护盾列表
|
self.shield:Clear() --护盾列表
|
||||||
self.exCalDmgList:Clear() --额外计算伤害列表
|
self.exCalDmgList:Clear() --额外计算伤害列表
|
||||||
self.buffFilter:Clear() --buff屏蔽列表
|
self.buffFilter:Clear() --buff屏蔽列表
|
||||||
|
@ -219,8 +219,13 @@ function RoleLogic:RemovePropertyTransfer(index, tran)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 是否为指定id,指定星级的英雄 by:王振兴 2020/07/29
|
||||||
|
function RoleLogic:IsAssignHeroAndHeroStar(id,star)
|
||||||
|
if self.roleId==id and self.star==star then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function RoleLogic:AddBuff(buff)
|
function RoleLogic:AddBuff(buff)
|
||||||
|
|
|
@ -265,7 +265,7 @@ function this.RefreshFightData(type)
|
||||||
data.element = roleData.PropertyName
|
data.element = roleData.PropertyName
|
||||||
data.professionId = roleData.Profession
|
data.professionId = roleData.Profession
|
||||||
data.quality = roleData.Quality
|
data.quality = roleData.Quality
|
||||||
data.star = roleData.Star
|
data.star = 10
|
||||||
data.type = 1
|
data.type = 1
|
||||||
local paskill = string.split(role.passivity, "#")
|
local paskill = string.split(role.passivity, "#")
|
||||||
data.passivity = BattleManager.GetPassivityData(paskill) or {}
|
data.passivity = BattleManager.GetPassivityData(paskill) or {}
|
||||||
|
|
|
@ -1303,8 +1303,9 @@ function this.TimeFormat()
|
||||||
end
|
end
|
||||||
|
|
||||||
--轮转活动,乾坤宝盒
|
--轮转活动,乾坤宝盒
|
||||||
local info= ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy)
|
local dynamicAct = not not ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy)
|
||||||
if info then
|
if dynamicAct then
|
||||||
|
local info = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FindFairy)
|
||||||
info = info.endTime - PlayerManager.serverTime
|
info = info.endTime - PlayerManager.serverTime
|
||||||
info = math.floor(info/86400)
|
info = math.floor(info/86400)
|
||||||
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy) then
|
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy) then
|
||||||
|
|
|
@ -152,6 +152,10 @@ end
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function RoleListPanel:OnShow()
|
function RoleListPanel:OnShow()
|
||||||
|
|
||||||
|
--检测成员红点
|
||||||
|
LogRed(" 检测成员红点 ")
|
||||||
|
CheckRedPointStatus(RedPointType.Role)
|
||||||
|
|
||||||
tarHero=HeroManager.GetAllHeroDatas()
|
tarHero=HeroManager.GetAllHeroDatas()
|
||||||
teamHero=FormationManager.GetWuJinFormationHeroIds(FormationTypeDef.FORMATION_NORMAL)
|
teamHero=FormationManager.GetWuJinFormationHeroIds(FormationTypeDef.FORMATION_NORMAL)
|
||||||
this.isFirstOpen=true
|
this.isFirstOpen=true
|
||||||
|
|
|
@ -133,7 +133,8 @@ function this:OnOpen(context)
|
||||||
end
|
end
|
||||||
-- 刷新显示状态
|
-- 刷新显示状态
|
||||||
self:RefreshBtnState()
|
self:RefreshBtnState()
|
||||||
|
--检测成员红点
|
||||||
|
CheckRedPointStatus(RedPointType.Role)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:RefreshBtnState()
|
function this:RefreshBtnState()
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace LJ_OptTools
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool ExtendTexture( string path)
|
public static bool ExtendTexture(string path)
|
||||||
{
|
{
|
||||||
var tex = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
var tex = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
||||||
var ti = AssetImporter.GetAtPath(path) as TextureImporter;
|
var ti = AssetImporter.GetAtPath(path) as TextureImporter;
|
||||||
|
@ -199,9 +199,9 @@ namespace LJ_OptTools
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetTextureFormat( string path, bool useCrunched)
|
public static void SetTextureFormat(string path, bool useCrunched)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(path)) return;
|
if (string.IsNullOrEmpty(path)) return;
|
||||||
var ti = AssetImporter.GetAtPath(path) as TextureImporter;
|
var ti = AssetImporter.GetAtPath(path) as TextureImporter;
|
||||||
if (ti == null)
|
if (ti == null)
|
||||||
{
|
{
|
||||||
|
@ -212,11 +212,24 @@ namespace LJ_OptTools
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ti.textureType == TextureImporterType.Sprite)
|
||||||
|
{
|
||||||
|
TextureImporterSettings tis = new TextureImporterSettings();
|
||||||
|
ti.ReadTextureSettings(tis);
|
||||||
|
if (tis.spriteMeshType != SpriteMeshType.FullRect)
|
||||||
|
{
|
||||||
|
tis.spriteMeshType = SpriteMeshType.FullRect;
|
||||||
|
ti.SetTextureSettings(tis);
|
||||||
|
AssetDatabase.WriteImportSettingsIfDirty(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var pAndSetting = ti.GetPlatformTextureSettings("Android");
|
var pAndSetting = ti.GetPlatformTextureSettings("Android");
|
||||||
var piPSetting = ti.GetPlatformTextureSettings("iPhone");
|
var piPSetting = ti.GetPlatformTextureSettings("iPhone");
|
||||||
var tex = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
var tex = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
||||||
bool pot = Mathf.IsPowerOfTwo(tex.width) && Mathf.IsPowerOfTwo(tex.height);
|
bool pot = Mathf.IsPowerOfTwo(tex.width) && Mathf.IsPowerOfTwo(tex.height);
|
||||||
SettingPlantformTex(ti, pAndSetting, useCrunched,pot);
|
SettingPlantformTex(ti, pAndSetting, useCrunched, pot);
|
||||||
ti.SetPlatformTextureSettings(pAndSetting);
|
ti.SetPlatformTextureSettings(pAndSetting);
|
||||||
SettingPlantformTex(ti, piPSetting, useCrunched, pot);
|
SettingPlantformTex(ti, piPSetting, useCrunched, pot);
|
||||||
ti.SetPlatformTextureSettings(piPSetting);
|
ti.SetPlatformTextureSettings(piPSetting);
|
||||||
|
@ -271,7 +284,7 @@ namespace LJ_OptTools
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filePaths.Count < 1) return;
|
if (filePaths.Count < 1) return;
|
||||||
|
|
||||||
for (int i = 0; i < filePaths.Count; i++)
|
for (int i = 0; i < filePaths.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -281,7 +294,7 @@ namespace LJ_OptTools
|
||||||
, path
|
, path
|
||||||
, i * 1f / filePaths.Count
|
, i * 1f / filePaths.Count
|
||||||
);
|
);
|
||||||
TextureSizeOptUtilities.ExtendTexture( path);
|
TextureSizeOptUtilities.ExtendTexture(path);
|
||||||
TextureSizeOptUtilities.SetTextureFormat(path, useCrunched);
|
TextureSizeOptUtilities.SetTextureFormat(path, useCrunched);
|
||||||
}
|
}
|
||||||
AssetDatabase.Refresh();
|
AssetDatabase.Refresh();
|
||||||
|
@ -296,27 +309,29 @@ namespace LJ_OptTools
|
||||||
var guid = AssetDatabase.FindAssets("t:Texture", new string[] { "Assets/ManagedResources" });
|
var guid = AssetDatabase.FindAssets("t:Texture", new string[] { "Assets/ManagedResources" });
|
||||||
List<string> floders = new List<string>();
|
List<string> floders = new List<string>();
|
||||||
int errorTexCount = 0;
|
int errorTexCount = 0;
|
||||||
|
|
||||||
for (int i = 0; i < guid.Length; i++)
|
for (int i = 0; i < guid.Length; i++)
|
||||||
{
|
{
|
||||||
string id = guid[i];
|
string id = guid[i];
|
||||||
var path = AssetDatabase.GUIDToAssetPath(id);
|
var path = AssetDatabase.GUIDToAssetPath(id);
|
||||||
|
|
||||||
if (
|
|
||||||
path.StartsWith("Assets/ManagedResources/Atlas")
|
|
||||||
) continue;
|
|
||||||
|
|
||||||
EditorUtility.DisplayProgressBar(
|
EditorUtility.DisplayProgressBar(
|
||||||
string.Format("Check Texture({0}/{1})", i, guid.Length)
|
string.Format("Check Texture({0}/{1})", i, guid.Length)
|
||||||
, path
|
, path
|
||||||
, i * 1f / guid.Length
|
, i * 1f / guid.Length
|
||||||
);
|
);
|
||||||
var floder = Path.GetDirectoryName(path);
|
|
||||||
var ti = AssetImporter.GetAtPath(path) as TextureImporter;
|
var ti = AssetImporter.GetAtPath(path) as TextureImporter;
|
||||||
if (ti == null)
|
if (ti == null)
|
||||||
{
|
{
|
||||||
//Debug.LogError("No TextureImporter:" + path);
|
//Debug.LogError("No TextureImporter:" + path);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
path.StartsWith("Assets/ManagedResources/Atlas")
|
||||||
|
) continue;
|
||||||
|
|
||||||
|
|
||||||
|
var floder = Path.GetDirectoryName(path);
|
||||||
|
|
||||||
var tex = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
var tex = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
||||||
|
|
||||||
var pAndSetting = ti.GetPlatformTextureSettings("Android");
|
var pAndSetting = ti.GetPlatformTextureSettings("Android");
|
||||||
|
@ -356,6 +371,46 @@ namespace LJ_OptTools
|
||||||
EditorUtility.ClearProgressBar();
|
EditorUtility.ClearProgressBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[MenuItem("Tools/图片优化/检查Material引用的图片", priority = 0)]
|
||||||
|
public static void OnMenuItem_CheckMat()
|
||||||
|
{
|
||||||
|
var guid = AssetDatabase.FindAssets("t:Material");
|
||||||
|
StringBuilder info = new StringBuilder();
|
||||||
|
for (int i = 0; i < guid.Length; i++)
|
||||||
|
{
|
||||||
|
var path = AssetDatabase.GUIDToAssetPath(guid[i]);
|
||||||
|
EditorUtility.DisplayProgressBar(
|
||||||
|
string.Format("检查Material引用的图片({0}/{1})", i, guid.Length)
|
||||||
|
, path
|
||||||
|
, i * 1f / guid.Length
|
||||||
|
);
|
||||||
|
|
||||||
|
var mat = AssetDatabase.LoadAssetAtPath<Material>(path);
|
||||||
|
var shader = mat.shader;
|
||||||
|
int pCount = ShaderUtil.GetPropertyCount(shader);
|
||||||
|
for (int j = 0; j < pCount; j++)
|
||||||
|
{
|
||||||
|
if (ShaderUtil.GetPropertyType(shader, j) != ShaderUtil.ShaderPropertyType.TexEnv) continue;
|
||||||
|
var pName = ShaderUtil.GetPropertyName(shader, j);
|
||||||
|
var tex = mat.GetTexture(pName);
|
||||||
|
var texPath = AssetDatabase.GetAssetPath(tex);
|
||||||
|
var ti = AssetImporter.GetAtPath(texPath) as TextureImporter;
|
||||||
|
if (ti == null) continue;
|
||||||
|
if( ti.textureType == TextureImporterType.Sprite)
|
||||||
|
{
|
||||||
|
info.AppendFormat("{0} : {1} ->> {2}\r\n",path,pName,texPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if( info.Length > 0)
|
||||||
|
{
|
||||||
|
Debug.Log(info.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorUtility.ClearProgressBar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue