コード例 #1
0
 internal static bool ShowAtPosition(Rect buttonRect)
 {
   if (DateTime.Now.Ticks / 10000L < SpriteEditorMenu.s_LastClosedTime + 50L)
     return false;
   Event.current.Use();
   if ((UnityEngine.Object) SpriteEditorMenu.s_SpriteEditorMenu == (UnityEngine.Object) null)
     SpriteEditorMenu.s_SpriteEditorMenu = ScriptableObject.CreateInstance<SpriteEditorMenu>();
   SpriteEditorMenu.s_SpriteEditorMenu.Init(buttonRect);
   return true;
 }
コード例 #2
0
 internal static bool ShowAtPosition(Rect buttonRect)
 {
     if (DateTime.Now.Ticks / 10000L < SpriteEditorMenu.s_LastClosedTime + 50L)
     {
         return(false);
     }
     Event.current.Use();
     if ((UnityEngine.Object)SpriteEditorMenu.s_SpriteEditorMenu == (UnityEngine.Object)null)
     {
         SpriteEditorMenu.s_SpriteEditorMenu = ScriptableObject.CreateInstance <SpriteEditorMenu>();
     }
     SpriteEditorMenu.s_SpriteEditorMenu.Init(buttonRect);
     return(true);
 }
コード例 #3
0
		internal static bool ShowAtPosition(Rect buttonRect)
		{
			long num = DateTime.Now.Ticks / 10000L;
			if (num >= SpriteEditorMenu.s_LastClosedTime + 50L)
			{
				Event.current.Use();
				if (SpriteEditorMenu.s_SpriteEditorMenu == null)
				{
					SpriteEditorMenu.s_SpriteEditorMenu = ScriptableObject.CreateInstance<SpriteEditorMenu>();
				}
				SpriteEditorMenu.s_SpriteEditorMenu.Init(buttonRect);
				return true;
			}
			return false;
		}
コード例 #4
0
        internal static bool ShowAtPosition(Rect buttonRect)
        {
            long num = DateTime.Now.Ticks / 10000L;

            if (num >= SpriteEditorMenu.s_LastClosedTime + 50L)
            {
                Event.current.Use();
                if (SpriteEditorMenu.s_SpriteEditorMenu == null)
                {
                    SpriteEditorMenu.s_SpriteEditorMenu = ScriptableObject.CreateInstance <SpriteEditorMenu>();
                }
                SpriteEditorMenu.s_SpriteEditorMenu.Init(buttonRect);
                return(true);
            }
            return(false);
        }
コード例 #5
0
        internal static bool ShowAtPosition(Rect buttonRect, SpriteFrameModule sf, ITextureDataProvider textureProvider)
        {
            // We could not use realtimeSinceStartUp since it is set to 0 when entering/exitting playmode, we assume an increasing time when comparing time.
            long nowMilliSeconds = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
            bool justClosed      = nowMilliSeconds < s_LastClosedTime + 50;

            if (!justClosed)
            {
                if (UnityEvent.current != null) // Event.current can be null during integration test
                {
                    UnityEvent.current.Use();
                }

                SpriteEditorMenu spriteEditorMenu = CreateInstance <SpriteEditorMenu>();
                spriteEditorMenu.Init(buttonRect, sf, textureProvider);
                return(true);
            }
            return(false);
        }
コード例 #6
0
        internal static bool ShowAtPosition(Rect buttonRect, SpriteFrameModule sf, ITexture2D previewTexture, ITexture2D selectedTexture)
        {
            long num = DateTime.Now.Ticks / 10000L;
            bool result;

            if (num >= SpriteEditorMenu.s_LastClosedTime + 50L)
            {
                if (UnityEngine.Event.current != null)
                {
                    UnityEngine.Event.current.Use();
                }
                SpriteEditorMenu spriteEditorMenu = ScriptableObject.CreateInstance <SpriteEditorMenu>();
                spriteEditorMenu.Init(buttonRect, sf, previewTexture, selectedTexture);
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
コード例 #7
0
        internal static bool ShowAtPosition(Rect buttonRect, SpriteFrameModule sf, ITextureDataProvider textureProvider)
        {
            long num = DateTime.Now.Ticks / 10000L;
            bool result;

            if (num >= SpriteEditorMenu.s_LastClosedTime + 50L)
            {
                if (Event.current != null)
                {
                    Event.current.Use();
                }
                SpriteEditorMenu spriteEditorMenu = ScriptableObject.CreateInstance <SpriteEditorMenu>();
                spriteEditorMenu.Init(buttonRect, sf, textureProvider);
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
コード例 #8
0
 private void OnDisable()
 {
     SpriteEditorMenu.s_LastClosedTime   = DateTime.Now.Ticks / 10000L;
     SpriteEditorMenu.s_SpriteEditorMenu = null;
 }
コード例 #9
0
 private void OnDisable()
 {
     Undo.undoRedoPerformed = (Undo.UndoRedoCallback)Delegate.Remove(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
     s_LastClosedTime       = DateTime.Now.Ticks / 0x2710L;
     s_SpriteEditorMenu     = null;
 }
コード例 #10
0
 private void OnDisable()
 {
   Undo.undoRedoPerformed -= new Undo.UndoRedoCallback(this.UndoRedoPerformed);
   SpriteEditorMenu.s_LastClosedTime = DateTime.Now.Ticks / 10000L;
   SpriteEditorMenu.s_SpriteEditorMenu = (SpriteEditorMenu) null;
 }
コード例 #11
0
		private void OnDisable()
		{
			SpriteEditorMenu.s_LastClosedTime = DateTime.Now.Ticks / 10000L;
			SpriteEditorMenu.s_SpriteEditorMenu = null;
		}
コード例 #12
0
 private void OnDisable()
 {
     Undo.undoRedoPerformed             -= new Undo.UndoRedoCallback(this.UndoRedoPerformed);
     SpriteEditorMenu.s_LastClosedTime   = DateTime.Now.Ticks / 10000L;
     SpriteEditorMenu.s_SpriteEditorMenu = (SpriteEditorMenu)null;
 }
コード例 #13
0
ファイル: SpriteEditorMenu.cs プロジェクト: demelev/projectHL
 private void OnDisable()
 {
     Undo.undoRedoPerformed = (Undo.UndoRedoCallback) Delegate.Remove(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
     s_LastClosedTime = DateTime.Now.Ticks / 0x2710L;
     s_SpriteEditorMenu = null;
 }