-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.Fixed require components check.
- Loading branch information
Showing
29 changed files
with
129 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
///////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Script : RequireComponentsAttribute.cs | ||
// Script : RequireOneOfComponentsAttribute.cs | ||
// Info : 特性 - 包含至少一个组件 | ||
// Author : ls9512 2019 | ||
// E-mail : [email protected] | ||
|
@@ -13,11 +13,14 @@ | |
namespace Aya.Tween | ||
{ | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] | ||
internal sealed class RequireComponentsAttribute : Attribute | ||
internal sealed class RequireOneOfComponentsAttribute : Attribute | ||
{ | ||
public Type[] Types; | ||
|
||
public RequireComponentsAttribute(params Type[] requiredComponents) { Types = requiredComponents; } | ||
public RequireOneOfComponentsAttribute(params Type[] requiredComponents) | ||
{ | ||
Types = requiredComponents; | ||
} | ||
|
||
/// <summary> | ||
/// 检查是否包含组件 | ||
|
@@ -39,7 +42,7 @@ public static bool Check(Type type, GameObject target) | |
/// <returns>结果</returns> | ||
public static Component Find(Type type, GameObject target) | ||
{ | ||
var classAttribute = type.GetCustomAttribute<RequireComponentsAttribute>(); | ||
var classAttribute = type.GetCustomAttribute<RequireOneOfComponentsAttribute>(); | ||
var types = classAttribute.Types; | ||
Component ret = null; | ||
for (var i = 0; i < types.Length; i++) | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,12 @@ | |
// E-mail : [email protected] | ||
// | ||
///////////////////////////////////////////////////////////////////////////// | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace Aya.Tween | ||
{ | ||
[RequireComponents(typeof(Scrollbar))] | ||
[RequireComponent(typeof(Scrollbar))] | ||
[Tweener(TweenType.Scrollbar)] | ||
public class TweenScrollbar : TweenFloatBase<Scrollbar> | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,12 @@ | |
// E-mail : [email protected] | ||
// | ||
///////////////////////////////////////////////////////////////////////////// | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace Aya.Tween | ||
{ | ||
[RequireComponents(typeof(Slider))] | ||
[RequireComponent(typeof(Slider))] | ||
[Tweener(TweenType.Slider)] | ||
public class TweenSlider : TweenFloatBase<Slider> | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.