Skip to content

Commit 6888320

Browse files
committed
Update Logo and Icon
1 parent c299fe6 commit 6888320

16 files changed

+198
-15
lines changed

Core/EditorResources/Icon_512.png

24.4 KB
Loading

Core/EditorResources/Icon_Animation.png.meta renamed to Core/EditorResources/Icon_512.png.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Core/Resources/TweenEditorSetting.asset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ MonoBehaviour:
1212
m_Script: {fileID: 11500000, guid: ef1c704e8e6509647bacb2ec6b42e749, type: 3}
1313
m_Name: TweenEditorSetting
1414
m_EditorClassIdentifier:
15+
IconLogo: {fileID: 2800000, guid: 6d048f6968a5d3d4a94457c136277103, type: 3}
1516
IconPlay: {fileID: 2800000, guid: c686fbed16129ed4e81babc55d689c56, type: 3}
1617
IconPause: {fileID: 2800000, guid: 9dd4b8cce4e39ec4ab80c6735da1bc11, type: 3}
1718
IconRefresh: {fileID: 2800000, guid: f4145439ba354c64f91a25ed628cf2e6, type: 3}

Core/Resources/TweenSetting.asset

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ MonoBehaviour:
1212
m_Script: {fileID: 11500000, guid: f6665a411bc260e479c734e26cb8fdce, type: 3}
1313
m_Name: TweenSetting
1414
m_EditorClassIdentifier:
15-
ShowManagerInHierarchy: 1
15+
ShowManagerObject: 1
16+
ShowTweenAnimationCounter: 1
1617
DefaultCurve:
1718
serializedVersion: 2
1819
m_Curve:
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/////////////////////////////////////////////////////////////////////////////
2+
//
3+
// Script : TweenManagerHierarchyCallBack.cs
4+
// Info : TweenManager Hierarchy 回调
5+
// Author : ls9512 2019
6+
// E-mail : ls9512@vip.qq.com
7+
//
8+
/////////////////////////////////////////////////////////////////////////////
9+
#if UNITY_EDITOR
10+
using System;
11+
using UnityEditor;
12+
using UnityEngine;
13+
14+
namespace Aya.Tween
15+
{
16+
[InitializeOnLoad]
17+
public class TweenManagerHierarchyCallBack
18+
{
19+
public static readonly EditorApplication.HierarchyWindowItemCallback HierarchyItemCallback;
20+
21+
private static readonly GUIStyle TweenCounterStyle = new GUIStyle
22+
{
23+
alignment = TextAnchor.LowerRight,
24+
fontSize = 9,
25+
normal = new GUIStyleState()
26+
{
27+
textColor = new Color(0.9f, 0.9f, 0.9f, 1f)
28+
}
29+
};
30+
31+
static TweenManagerHierarchyCallBack()
32+
{
33+
HierarchyItemCallback = DrawHierarchyIcon;
34+
EditorApplication.hierarchyWindowItemOnGUI =
35+
(EditorApplication.HierarchyWindowItemCallback) Delegate.Combine(
36+
EditorApplication.hierarchyWindowItemOnGUI, HierarchyItemCallback);
37+
}
38+
39+
private static void DrawHierarchyIcon(int instanceID, Rect selectionRect)
40+
{
41+
var go = EditorUtility.InstanceIDToObject(instanceID) as GameObject;
42+
if (go == null) return;
43+
44+
var check = false;
45+
var condition1 = go.name.Contains("UTween");
46+
var count = 0;
47+
if (TweenSetting.Ins.ShowTweenAnimationCounter)
48+
{
49+
count = go.GetComponentsInChildren<TweenAnimation>(true).Length;
50+
}
51+
52+
var condition2 = count > 0;
53+
check = condition1 || condition2;
54+
55+
if (check && count == 0)
56+
{
57+
var iconRect = new Rect(selectionRect.x + selectionRect.width - 16f + 1f, selectionRect.y + 1f, 14f, 14f);
58+
GUI.DrawTexture(iconRect, TweenEditorSetting.Ins.IconLogo);
59+
}
60+
61+
if (check && count > 0)
62+
{
63+
var iconRect = new Rect(selectionRect.x + selectionRect.width - 16f + 1f, selectionRect.y + 1f, 14f, 14f);
64+
GUI.DrawTexture(iconRect, TweenEditorSetting.Ins.IconLogo, ScaleMode.ScaleToFit, true, 0f, Color.white * 0.55f,
65+
Vector4.zero, Vector4.zero);
66+
67+
var textRect = new Rect(selectionRect.x + selectionRect.width - 48f, selectionRect.y , 48f, 16f);
68+
EditorGUI.LabelField(textRect, count.ToString(),TweenCounterStyle);
69+
}
70+
}
71+
}
72+
}
73+
#endif

Core/Script/Editor/TweenManagerHierarchyCallBack.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Core/Script/TweenAnimation.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Core/Script/TweenManager.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,19 @@ public static TweenManager Ins
3535
Instance = FindObjectOfType<TweenManager>();
3636
if (Instance == null)
3737
{
38-
var hideFlag = TweenSetting.Ins.ShowManagerInHierarchy ? HideFlags.None : HideFlags.HideAndDontSave;
39-
var insName = nameof(TweenManager);
38+
var hideFlag = TweenSetting.Ins.ShowManagerObject ? HideFlags.None : HideFlags.HideAndDontSave;
39+
var insName = "UTween";
4040
if (!Application.isPlaying)
4141
{
42-
insName = "~" + nameof(TweenManager) + " (Editor)";
42+
insName = "UTween (Editor)";
4343
}
4444

4545
var obj = new GameObject
4646
{
4747
name = insName,
4848
hideFlags = hideFlag,
4949
};
50+
5051
Instance = obj.AddComponent<TweenManager>();
5152
}
5253
}

Core/Script/TweenManager.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Core/Script/_Setting/TweenAnimationAsset.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Core/Script/_Setting/TweenEditorSetting.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ internal static TweenEditorSetting Load(string fileName)
3939
#endregion
4040

4141
[Header("Icon")]
42+
public Texture2D IconLogo;
4243
public Texture2D IconPlay;
4344
public Texture2D IconPause;
4445
public Texture2D IconRefresh;

Core/Script/_Setting/TweenSetting.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ internal static TweenSetting Load(string fileName)
3838

3939
#endregion
4040

41-
[Header("General Setting")]
42-
public bool ShowManagerInHierarchy = true;
41+
[Header("Hierarchy Setting")]
42+
public bool ShowManagerObject = true;
43+
public bool ShowTweenAnimationCounter = true;
4344

4445
[Header("Default Value")]
4546
public AnimationCurve DefaultCurve = new AnimationCurve(new Keyframe(0, 0, 1, 1), new Keyframe(1, 1, 1, 1));

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# UTween
1+
<img src="/Res/Logo_1200x284.png"/>
2+
23
**UTween** is an interpolation animation component for **Unity**. You can quickly configure animations through built-in components or write animations through code.
34

45
![topLanguage](https://img.shields.io/github/languages/top/ls9512/UTween)
@@ -11,7 +12,7 @@
1112
[[中文文档]](README_CN.md)
1213

1314
<!-- vscode-markdown-toc -->
14-
* 1. [Quick start](#Quickstart)
15+
* 1. [Quick Start](#QuickStart)
1516
* 1.1. [Features](#Features)
1617
* 1.2. [Environment](#Environment)
1718
* 1.3. [Preview](#Preview)
@@ -51,7 +52,7 @@
5152
/vscode-markdown-toc-config -->
5253
<!-- /vscode-markdown-toc -->
5354

54-
## 1. <a name='Quickstart'></a>Quick start
55+
## 1. <a name='QuickStart'></a>Quick Start
5556
### 1.1. <a name='Features'></a>Features
5657
* Provide detailed parameters to achieve high freedom of custom animation.
5758
* Built-in animation realization of translation, rotation, scaling, value, color, etc. of a large number of commonly used components.
@@ -363,7 +364,7 @@ public class TweenTextFontSize : TweenFloatBase<Text>
363364
{
364365
Component.fontSize = (int)value;
365366
#if UNITY_EDITOR
366-
// 确保编辑器预览刷新
367+
// Refresh for editor preview
367368
if (!Application.isPlaying)
368369
{
369370
UnityEditor.EditorUtility.SetDirty(Component);

README_CN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# UTween
1+
<img src="/Res/Logo_1200x284.png"/>
2+
23
**UTween** 是一个 **Unity** 环境下的插值动画组件,可以通过内置组件快速配置动画,或者通过代码编写动画。
34

45
![topLanguage](https://img.shields.io/github/languages/top/ls9512/UTween)
Loading

Res/Logo_1200x284.png.meta

Lines changed: 92 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)