【战斗】============战斗图片字显示修改

dev_chengFeng
wangzhenxing 2021-06-30 18:06:56 +08:00
parent b99c52d22c
commit 2578107be4
16 changed files with 243 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c40414bfdea41834499100ba1215d015
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,14 @@
info face="Arial" size=32 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
common lineHeight=32 base=26 scaleW=256 scaleH=128 pages=1 packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4
page id=0 file="ArtFont_4_0.png"
chars count=10
char id=48 x=41 y=0 width=40 height=57 xoffset=0 yoffset=0 xadvance=40 page=0 chnl=15
char id=49 x=116 y=58 width=23 height=56 xoffset=0 yoffset=0 xadvance=23 page=0 chnl=15
char id=50 x=36 y=59 width=39 height=56 xoffset=0 yoffset=0 xadvance=39 page=0 chnl=15
char id=51 x=76 y=58 width=39 height=56 xoffset=0 yoffset=0 xadvance=39 page=0 chnl=15
char id=52 x=0 y=0 width=40 height=58 xoffset=0 yoffset=0 xadvance=40 page=0 chnl=15
char id=53 x=82 y=0 width=40 height=57 xoffset=0 yoffset=0 xadvance=40 page=0 chnl=15
char id=54 x=123 y=0 width=40 height=57 xoffset=0 yoffset=0 xadvance=40 page=0 chnl=15
char id=55 x=0 y=59 width=35 height=57 xoffset=0 yoffset=0 xadvance=35 page=0 chnl=15
char id=56 x=164 y=0 width=40 height=57 xoffset=0 yoffset=0 xadvance=40 page=0 chnl=15
char id=57 x=205 y=0 width=40 height=57 xoffset=0 yoffset=0 xadvance=40 page=0 chnl=15

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4589a2d448a765842804507a4ed652b2
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 1fce59d7564616f4391c013750e3fc05
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 56
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 02161ddbefc55824f9d77653100d4ffd
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,31 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!128 &12800000
Font:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ArtFont_4_cfont
serializedVersion: 5
m_LineSpacing: 0.1
m_DefaultMaterial: {fileID: 0}
m_FontSize: 0
m_Texture: {fileID: 0}
m_AsciiStartOffset: 0
m_Tracking: 1
m_CharacterSpacing: 0
m_CharacterPadding: 1
m_ConvertCase: 0
m_CharacterRects: []
m_KerningValues: []
m_PixelScale: 0.1
m_FontData:
m_Ascent: 0
m_Descent: 0
m_DefaultStyle: 0
m_FontNames: []
m_FallbackFonts: []
m_FontRenderingMode: 0
m_UseLegacyBoundsCalculation: 0
m_ShouldRoundAdvanceValue: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 986902c55e2de8d49b3c6b79d5c83044
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 12800000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ArtFont_4_mat
m_Shader: {fileID: 10101, guid: 0000000000000000e000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: []
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 07a42bba2063bab4da514db380832200
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -440,7 +440,7 @@ function EnemyView:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotTyp
--if self.isDead then return end
if dotType then
if dotType == DotType.Poison then
self.Floater:ArtFloating(ArtFloatingType.PoisonDamage, ArtFloatingColor.Poison, dmg)
self.Floater:ArtFloating(ArtFloatingType.PoisonDamage, ArtFloatingColor.White, dmg,TextFloatingColor.DarkGreen)
elseif dotType == DotType.Burn then
self.Floater:ArtFloating(ArtFloatingType.FireDamage, ArtFloatingColor.Fire, dmg)
@ -504,7 +504,7 @@ function EnemyView:RoleRageChange(deltaRage)
if deltaRage > 0 then
self.Floater:ImageBuffFloating("z_zhandou_nuqijia_zh", nil, deltaRage)
else
self.Floater:ImageBuffFloating("z_zhandou_nuqijian_zh", nil, deltaRage)
self.Floater:ImageBuffFloating("z_zhandou_nuqijian_zh", nil, deltaRage,0,1)
--self.Floater:TextBuffFloating(1, Language[10245]..tostring(deltaRage))
end
end

View File

@ -9,12 +9,15 @@ TextFloatingColor = {
Red = 2,
Purple = 3,
Green = 4,
DarkGreen=5,
}
local _FloatingTypeToColor = {
[TextFloatingColor.Blue] = Color.New(31, 237, 255, 255) / 255,
[TextFloatingColor.Red] = Color.New(236, 4, 4, 255) / 255,
[TextFloatingColor.Purple] = Color.New(235, 17, 255, 255) / 255,
[TextFloatingColor.Green] = Color.New(17, 255, 17, 255) / 255,
[TextFloatingColor.DarkGreen] = Color.New(56, 127, 46, 255) / 255,
}
-- 艺术字
@ -102,7 +105,7 @@ function FloatNode:TextBuffFloating(type, text)
end
--
function FloatNode:ImageBuffFloating(textImg, numImg, numTxt,type)
function FloatNode:ImageBuffFloating(textImg, numImg, numTxt,type,isPurple)
local go = BattleManager.LoadAsset(buffFloatingEffect)
local baseY = 0
@ -128,10 +131,10 @@ function FloatNode:ImageBuffFloating(textImg, numImg, numTxt,type)
local img1 = Util.GetGameObject(go, "anim/grid/Image1"):GetComponent("Image")
local img2 = Util.GetGameObject(go, "anim/grid/Image2"):GetComponent("Image")
local txt3 = Util.GetGameObject(go, "anim/grid/Text"):GetComponent("Text")
local txt4 = Util.GetGameObject(go, "anim/grid/Text1"):GetComponent("Text")
if textImg then
img1.gameObject:SetActive(true)
if type~=nil then
if type~=nil and type~=0 then
local list = string.split(textImg, "#")
if list and LengthOfTable(list)>1 then
textImg=list[type]
@ -150,12 +153,21 @@ function FloatNode:ImageBuffFloating(textImg, numImg, numTxt,type)
else
img2.gameObject:SetActive(false)
end
if numTxt then
txt3.gameObject:SetActive(true)
if isPurple then
txt4.gameObject:SetActive(true)
txt3.gameObject:SetActive(false)
else
txt4.gameObject:SetActive(false)
txt3.gameObject:SetActive(true)
end
txt3.text = numTxt
txt4.text = numTxt
else
txt3.gameObject:SetActive(false)
txt4.gameObject:SetActive(false)
end
BattleManager.AddDelayRecycleRes(buffFloatingEffect, go, 1.3)
@ -188,7 +200,7 @@ function FloatNode:GetArtText(type, color, value)
end
return sp, text
end
function FloatNode:ArtFloating(type, color, value)
function FloatNode:ArtFloating(type, color, value,frameColor)
local go = BattleManager.LoadAsset(floatingEffect)
go.transform:SetParent(self.RootPanel.transform)
go.transform.localScale = Vector3.one * 0.7
@ -219,6 +231,12 @@ function FloatNode:ArtFloating(type, color, value)
local animTxt = Util.GetGameObject(go, "anim/anim")
local animTxtC = animTxt:GetComponent("Text")
animTxtC.text = text
--主要用于给白色字体染色成其他颜色color 参数只能填白色
if frameColor then
local color1 = _FloatingTypeToColor[frameColor]
animTxtC.color= color1
end
-- 层级和动画
anim:GetComponent("Canvas").sortingOrder = BattleManager.GetBattleSorting() + 100
anim:GetComponent("Animator"):Play(ArtFloatingAnim[type])

View File

@ -467,7 +467,7 @@ function PlayerView:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotTy
--if self.isDead then return end
if dotType then
if dotType == DotType.Poison then
self.Floater:ArtFloating(ArtFloatingType.PoisonDamage, ArtFloatingColor.Poison, dmg)
self.Floater:ArtFloating(ArtFloatingType.PoisonDamage, ArtFloatingColor.White, dmg,TextFloatingColor.DarkGreen)
elseif dotType == DotType.Burn then
self.Floater:ArtFloating(ArtFloatingType.FireDamage, ArtFloatingColor.Fire, dmg)
@ -547,7 +547,7 @@ function PlayerView:RoleRageChange(deltaRage)
if deltaRage > 0 then
self.Floater:ImageBuffFloating("z_zhandou_nuqijia_zh", nil, deltaRage)
else
self.Floater:ImageBuffFloating("z_zhandou_nuqijian_zh",nil,deltaRage)
self.Floater:ImageBuffFloating("z_zhandou_nuqijian_zh", nil, deltaRage,0,1)
end
end
end

View File

@ -495,7 +495,7 @@ function RoleView:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType
--if self.isDead then return end
if dotType then
if dotType == DotType.Poison then
self.Floater:ArtFloating(ArtFloatingType.PoisonDamage, ArtFloatingColor.Poison, dmg)
self.Floater:ArtFloating(ArtFloatingType.PoisonDamage, ArtFloatingColor.White, dmg,TextFloatingColor.DarkGreen)
elseif dotType == DotType.Burn then
self.Floater:ArtFloating(ArtFloatingType.FireDamage, ArtFloatingColor.Fire, dmg)
@ -583,7 +583,7 @@ function RoleView:RoleRageChange(deltaRage)
if deltaRage > 0 then
self.Floater:ImageBuffFloating("z_zhandou_nuqijia_zh", nil, deltaRage)
else
self.Floater:ImageBuffFloating("z_zhandou_nuqijian_zh", nil, deltaRage)
self.Floater:ImageBuffFloating("z_zhandou_nuqijian_zh", nil, deltaRage,0,1)
end
end
end