移除不用的脚本
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
// Support reloading scripts after a recompile - static reference will be cleared, but we can find it again.
|
||||
T autoSingleton = FindObjectOfType<T>();
|
||||
T autoSingleton = FindFirstObjectByType<T>();
|
||||
if (autoSingleton != null)
|
||||
{
|
||||
_instance = autoSingleton;
|
||||
@@ -65,10 +65,12 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
// Make sure the instance isn't referenced anymore when the user quit, just in case.
|
||||
#if UNITY_EDITOR
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
// Null any references when exiting play mode.
|
||||
_instance = null;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,31 +124,6 @@
|
||||
get { return CachedTransform; }
|
||||
}
|
||||
|
||||
#if !UNITY_5 && !UNITY_2017_1_OR_NEWER
|
||||
|
||||
public new Collider collider
|
||||
{
|
||||
get { return CachedCollider; }
|
||||
}
|
||||
public new Collider2D collider2D
|
||||
{
|
||||
get { return CachedCollider2D; }
|
||||
}
|
||||
public new Rigidbody rigidbody
|
||||
{
|
||||
get { return CachedRigidBody; }
|
||||
}
|
||||
public new Rigidbody2D rigidbody2D
|
||||
{
|
||||
get { return CachedRigidBody2D; }
|
||||
}
|
||||
public new GameObject gameObject
|
||||
{
|
||||
get { return CachedGameObject; }
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// ReSharper restore InconsistentNaming
|
||||
|
||||
private Collider _collider;
|
||||
|
||||
@@ -73,10 +73,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the instance isn't referenced anymore when the user quit, just in case.
|
||||
#if UNITY_EDITOR
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
// Null any references when exiting play mode.
|
||||
_instance = null;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,14 @@
|
||||
// Check cache
|
||||
if (Cache.TryGetValue(key, out t))
|
||||
{
|
||||
return t;
|
||||
if (t == null)
|
||||
{
|
||||
Cache.Remove(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
var find = GameObject.Find(key);
|
||||
@@ -61,13 +68,11 @@
|
||||
return t;
|
||||
}
|
||||
|
||||
#if (!UNITY_2017 && !UNITY_2018 && !UNITY_2019) || UNITY_2019_3_OR_NEWER
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
public static void RuntimeInitialize()
|
||||
{
|
||||
// To handle entering play mode without a domain reload, need to reset the state of the service manager.
|
||||
// To handle entering play mode without a domain reload, reset the state of the service manager.
|
||||
Cache.Clear();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,11 +66,7 @@ namespace SRF.Service
|
||||
}
|
||||
|
||||
SRServiceManager.LoadingCount++;
|
||||
#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
|
||||
if (Application.loadedLevelName == SceneName)
|
||||
#else
|
||||
if (UnityEngine.SceneManagement.SceneManager.GetSceneByName(SceneName).isLoaded)
|
||||
#endif
|
||||
{
|
||||
Log("[Service] Already in service scene {0}. Searching for root object...".Fmt(SceneName), this);
|
||||
}
|
||||
@@ -78,16 +74,7 @@ namespace SRF.Service
|
||||
{
|
||||
Log("[Service] Loading scene ({0})".Fmt(SceneName), this);
|
||||
|
||||
#if UNITY_PRO_LICENSE || UNITY_5 || UNITY_5_3_OR_NEWER
|
||||
#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
|
||||
yield return Application.LoadLevelAdditiveAsync(SceneName);
|
||||
#else
|
||||
yield return UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(SceneName, UnityEngine.SceneManagement.LoadSceneMode.Additive);
|
||||
#endif
|
||||
#else
|
||||
Application.LoadLevelAdditive(SceneName);
|
||||
yield return new WaitForEndOfFrame();
|
||||
#endif
|
||||
|
||||
Log("[Service] Scene loaded. Searching for root object...", this);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace SRF.Service
|
||||
public const bool EnableLogging = false;
|
||||
#endif
|
||||
|
||||
#if UNITY_EDITOR && ((!UNITY_2017 && !UNITY_2018 && !UNITY_2019) || UNITY_2019_3_OR_NEWER)
|
||||
#if UNITY_EDITOR
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
public static void RuntimeInitialize()
|
||||
{
|
||||
@@ -350,13 +350,13 @@ namespace SRF.Service
|
||||
return null;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
protected void OnApplicationQuit()
|
||||
{
|
||||
_hasQuit = true;
|
||||
_assemblies.Clear();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
protected void OnDisable()
|
||||
{
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
|
||||
public override void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
//Debug.Log("OnPointerClick (isFocused: {0}, isUsed: {1}, isDragging: {2})".Fmt(isFocused, eventData.used, eventData.dragging));
|
||||
|
||||
if (!interactable)
|
||||
{
|
||||
return;
|
||||
@@ -56,19 +54,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
//Debug.Log("OnPointerDown (isFocused: {0}, isUsed: {1})".Fmt(isFocused, eventData.used));
|
||||
public override void OnPointerDown(PointerEventData eventData) { }
|
||||
|
||||
//base.OnPointerDown(eventData);
|
||||
}
|
||||
|
||||
public override void OnPointerUp(PointerEventData eventData)
|
||||
{
|
||||
//Debug.Log("OnPointerUp (isFocused: {0}, isUsed: {1})".Fmt(isFocused, eventData.used));
|
||||
|
||||
//base.OnPointerUp(eventData);
|
||||
}
|
||||
public override void OnPointerUp(PointerEventData eventData) { }
|
||||
|
||||
public override void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
@@ -77,8 +65,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
//Debug.Log("OnBeginDrag (isFocused: {0}, isUsed: {1}, delta: {2})".Fmt(isFocused, eventData.used, eventData.delta));
|
||||
|
||||
// Pass event to parent if it is a vertical drag
|
||||
if (Mathf.Abs(eventData.delta.y) > Mathf.Abs(eventData.delta.x))
|
||||
{
|
||||
@@ -126,8 +112,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
//Debug.Log("OnDrag (isFocused: {0}, isUsed: {1})".Fmt(isFocused, eventData.used));
|
||||
|
||||
var diff = eventData.delta.x;
|
||||
|
||||
_currentValue += Math.Abs(_dragStep)*diff*DragSensitivity;
|
||||
@@ -160,15 +144,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
//Debug.Log("OnEndDrag (isFocused: {0}, isUsed: {1})".Fmt(isFocused, eventData.used));
|
||||
|
||||
//base.OnEndDrag(eventData);
|
||||
|
||||
eventData.Use();
|
||||
|
||||
if (_dragStartAmount != _currentValue)
|
||||
{
|
||||
DeactivateInputField();
|
||||
SendOnEndEdit();
|
||||
SendOnSubmit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user