Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix auto generate icon's error & platform protect #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Assets/Stickers/Editor/AssetCatalog.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_IOS
using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -706,3 +707,4 @@ public override void Write()
}

} // namespace UnityEditor.iOS.Xcode
#endif
3 changes: 3 additions & 0 deletions Assets/Stickers/Editor/PBX/Objects.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_IOS
using System.Collections.Generic;
using System.Collections;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -891,3 +892,5 @@ public override void UpdateVars()
}

} // namespace UnityEditor.iOS.Xcode

#endif
2 changes: 2 additions & 0 deletions Assets/Stickers/Editor/PBX/Sections.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_IOS
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down Expand Up @@ -119,3 +120,4 @@ public PBXProjectObjectData project
}

} // UnityEditor.iOS.Xcode
#endif
2 changes: 2 additions & 0 deletions Assets/Stickers/Editor/PBX/Serializer.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_IOS
using System;
using System.Collections.Generic;
using System.Text;
Expand Down Expand Up @@ -256,3 +257,4 @@ public static void WriteArray(StringBuilder sb, PBXElementArray el, int indent,
}

} // namespace UnityEditor.iOS.Xcode
#endif
2 changes: 2 additions & 0 deletions Assets/Stickers/Editor/PBX/Utils.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_IOS
using System;
using System.Collections.Generic;
using System.Text;
Expand Down Expand Up @@ -352,3 +353,4 @@ public static string[] SplitPath(string path)
}

} // UnityEditor.iOS.Xcode
#endif
2 changes: 2 additions & 0 deletions Assets/Stickers/Editor/PBXProject.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_IOS
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -1361,3 +1362,4 @@ public static string FixSlashes(string s)
}

} // namespace UnityEditor.iOS.Xcode
#endif
2 changes: 2 additions & 0 deletions Assets/Stickers/Editor/PBXProjectData.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if UNITY_IOS
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -683,3 +684,4 @@ bool RepairStructureImpl(Dictionary<string, bool> allGuids)

} // namespace UnityEditor.iOS.Xcode

#endif
2 changes: 1 addition & 1 deletion Assets/Stickers/Editor/StickerPackEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private void DrawElementBackgroundCallback(Rect rect, int index, bool selected,

GUI.Box(Rect.MinMaxRect(rect.xMin + 1f, rect.yMin, rect.xMax - 3f, rect.yMax), string.Empty);

if (Event.current.type != EventType.Repaint)
if (Event.current.type != UnityEngine.EventType.Repaint)
return;

if (elementStyle == null)
Expand Down
6 changes: 4 additions & 2 deletions Assets/Stickers/Editor/StickerTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
#if UNITY_IOS
using System.IO;
using Agens;
using UnityEngine;
using UnityEditor;
Expand Down Expand Up @@ -47,4 +48,5 @@ private static void AssertSequence(Sticker sticker, int i)
Assert.LessOrEqual(StickerPackEditor.CalculateFileSize(sticker), 500000, "Sticker " + sticker.Name + " is larger than the allowed 500KB");
}
}
}
}
#endif
6 changes: 4 additions & 2 deletions Assets/Stickers/Editor/StickersBuildPostProcess.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using UnityEditor;
#if UNITY_IOS
using UnityEditor;
using UnityEditor.Callbacks;

namespace Agens.Stickers
Expand All @@ -16,4 +17,5 @@ public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProj
StickersExport.WriteToProject(pathToBuiltProject);
}
}
}
}
#endif
6 changes: 4 additions & 2 deletions Assets/Stickers/Editor/StickersExport.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#if UNITY_IOS
using System;
using UnityEngine;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -372,4 +373,5 @@ private static PlistDocument CreatePList(string name, string versionString = "1.
return list;
}
}
}
}
#endif
2 changes: 1 addition & 1 deletion Assets/Stickers/StickerPackIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public Texture2D GetDefaultTexture(int width, int height)
return null;
}

var scaled = TextureScale.ScaledResized(appStore, width, height, Settings.BackgroundColor, Settings.FillPercentage / 100f, Settings.FilterMode, Settings.ScaleMode);
var scaled = TextureScale.ScaledResized(width == height ? appStore : messagesAppStore, width, height, Settings.BackgroundColor, Settings.FillPercentage / 100f, Settings.FilterMode, Settings.ScaleMode);
if (scaled != null)
{
scaled.name = width + "x" + height;
Expand Down
2 changes: 1 addition & 1 deletion Assets/Stickers/TextureScale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static Texture2D ScaledResized(Texture2D src, int width, int height, Colo
}

var rtt = CreateScaledTexture(src,width,height,backgroundColor,fillPercentage,mode, anchor);

RenderTexture.active = rtt;
var texR = new Rect(0,0,width,height);
result.ReadPixels(texR,0,0,true);
result.Apply(false);
Expand Down