randomInt() 공개 정적인 메소드

public static randomInt ( ) : int
리턴 int
예제 #1
0
        /** 初始化 */
        private static void init()
        {
            if (!ShineSetting.isRelease)
            {
                //编辑器模式
                ShineSetting.isEditor = true;
            }

            //如果运行中,就停止,防止unity的内存清空导致一堆无意义报错
            if (EditorApplication.isPlaying)
            {
                EditorApplication.isPlaying = false;
            }

            EditorApplication.update                   += Update;
            EditorApplication.hierarchyChanged         += OnHierarchyChanged;
            EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemOnGUI;
            EditorApplication.projectChanged           += OnProjectChanged;
            EditorApplication.projectWindowItemOnGUI   += ProjectWindowItemOnGUI;
            EditorApplication.modifierKeysChanged      += OnModifierKeysChanged;

            EditorApplication.searchChanged        += OnSearchChanged;
            EditorApplication.pauseStateChanged    += OnPauseStateChanged;
            EditorApplication.playModeStateChanged += OnPlayModeStateChanged;

            PrefabUtility.prefabInstanceUpdated += onPrefabUpdated;

            _version = MathUtils.randomInt();

            _callLaterList = new SList <Action>();
            _updateList    = new SList <Action>();

            _isNewOnce = true;
        }
예제 #2
0
 public IPAddress getOne()
 {
     if (_lastIndex == -1)
     {
         _lastIndex = MathUtils.randomInt(ipArr.Length);
         return(ipArr[_lastIndex]);
     }
     else
     {
         return(ipArr[(++_lastIndex) % ipArr.Length]);
     }
 }
예제 #3
0
파일: IntSet.cs 프로젝트: shineTeam7/home3
        private int findNewFreeOrRemoved()
        {
            int free = _freeValue;

            int newFree;

            {
                do
                {
                    newFree = MathUtils.randomInt();
                }while((newFree == free) || ((index(newFree)) >= 0));
            }

            return(newFree);
        }
예제 #4
0
        private char findNewFreeOrRemoved()
        {
            char free = _freeValue;

            char newFree;

            {
                do
                {
                    newFree = (char)MathUtils.randomInt();
                }while((newFree == free) || ((index(newFree)) >= 0));
            }

            return(newFree);
        }
예제 #5
0
        /// <summary>
        /// http请求
        /// </summary>
        public static void httpRequest(string url, int method = HttpMethodType.Get, string data = null, Action <string> completeFunc = null, Action errorFunc = null)
        {
            if (url.IndexOf('?') == -1)
            {
                url += "?v=" + MathUtils.randomInt(1000000);
            }
            else
            {
                url += "&v=" + MathUtils.randomInt(1000000);
            }

            SimpleHttpRequest request = SimpleHttpRequest.create();

            request._url          = url;
            request._method       = method;
            request._postData     = data;
            request._completeFunc = completeFunc;
            request._errorFunc    = errorFunc;

            request.send();
        }