Esempio n. 1
0
        public void SetSource()
        {
            var folder = FindObjects.FindFolders(currentPath);
            var files  = FindObjects.FindFiles(currentPath);

            Elements = folder;
            for (int i = 0; i < files.Count; i++)
            {
                Elements.Add(files[i]);
            }
            try
            {
                ElementList.ItemsSource = Elements;
            }
            catch { }
            for (int i = 0; i < Elements.Count; i++)
            {
                for (int j = 0; j < CheckedElements.Count; j++)
                {
                    if (CheckedElements[j].path == Elements[i].path)
                    {
                        Elements[i].isSelected = CheckedElements[j].isSelected;
                        break;
                    }
                }
            }
            ShowingPath           = currentPath;
            CurrDir.Text          = ShowingPath;
            CheckList.ItemsSource = CheckedElements;
        }
Esempio n. 2
0
        private void Start()
        {
            // Destroy any NSTs the developer may have left in the scene.
            List <NetworkSyncTransform> nsts = FindObjects.FindObjectsOfTypeAllInScene <NetworkSyncTransform>(true);

            for (int i = 0; i < nsts.Count; i++)
            {
                Destroy(nsts[i].gameObject);
            }

            // Not ideal code to prevent hitching issues with vsync being off - ensures a reasonable framerate is being enforced
            if (QualitySettings.vSyncCount == 0)
            {
                if (Application.targetFrameRate <= 0)
                {
                    Application.targetFrameRate = 60;
                }
                else
                {
                    Application.targetFrameRate = Application.targetFrameRate;
                }

                DebugX.LogWarning(!DebugX.logWarnings ? "" :
                                  ("VSync appears to be disabled, which can cause some problems with Networking. \nEnforcing the current framerate of " + Application.targetFrameRate +
                                   " to prevent hitching. Enable VSync or set 'Application.targetFrameRate' as desired if this is not the framerate you would like."));
            }
        }
Esempio n. 3
0
        public static NetworkManager GetNetworkManagerSingleton()
        {
            if (NetworkManager.singleton == null)
            {
                List <NetworkManager> found = FindObjects.FindObjectsOfTypeAllInScene <NetworkManager>();
                if (found.Count > 0)
                {
                    NetworkManager.singleton = found[0];
                }
                else
                {
                    DebugX.LogWarning(!DebugX.logWarnings ? "" : ("No NetworkManager in scene. Adding one now."));

                    GameObject nmGo = GameObject.Find("Network Manager");

                    if (nmGo == null)
                    {
                        nmGo = new GameObject("Network Manager");
                    }

                    NetworkManager.singleton = nmGo.AddComponent <NetworkManager>();
                }
            }

            // Add a HUD if that is also missing
            if (NetworkManager.singleton.gameObject.GetComponent <NetworkManagerHUD>() == null)
            {
                NetworkManager.singleton.gameObject.AddComponent <NetworkManagerHUD>();
            }


            return(NetworkManager.singleton);
        }
Esempio n. 4
0
        private void ReadyToBuy(bool isReady)
        {
            confirmToBuy = isReady;

            FindObjects.GetUIText(UITag.BuyPowerModeline).text = isReady
                ? text.GetStringData("BuyPower", "Confirm")
                : "";
        }
Esempio n. 5
0
    public void addNewsEvent(FindObjects findObjects, NewsEffect newsEffect)
    {
        NewsEvent newsEvent = new NewsEvent();

        newsEvent.findObjects = findObjects;
        newsEvent.newsEffect  = newsEffect;
        newsEvents.Add(newsEvent);
    }
Esempio n. 6
0
        private void MoveExaminer()
        {
            int[] target = coord.Convert(
                GetComponent <PlayerInput>().GameCommand(),
                FindObjects.GetStaticActor(SubObjectTag.Examiner)
                .transform.position);

            GetComponent <IMove>().MoveGameObject(target);
        }
Esempio n. 7
0
    // Use this for initialization

    void Start()
    {
        player        = GameObject.FindGameObjectWithTag("Player");
        playerLastPos = this.transform.position;
        findObj       = GameObject.FindGameObjectWithTag("Player").GetComponent <FindObjects>();
        ewc           = this.GetComponent <EnemyWeponContoller>();
        rid           = this.GetComponent <Rigidbody2D>();
        layerMask     = ~layerMask;
    }
        private void Start()
        {
            // Destroy any NSTs the developer may have left in the scene.
            List <NetworkSyncTransform> nsts = FindObjects.FindObjectsOfTypeAllInScene <NetworkSyncTransform>(true);

            for (int i = 0; i < nsts.Count; i++)
            {
                Destroy(nsts[i].gameObject);
            }
        }
Esempio n. 9
0
        internal void Folders(string path)
        {
            foreach (var p in FindObjects.FindFolders(path))
            {
                var files = FindObjects.FindFiles(p.path);
                foreach (var t in files)
                {
                    CheckedElements.Add(t);
                }

                Folders(p.path);
            }
        }
Esempio n. 10
0
    public static void executequeries(SqliteConnection dbconn, SqliteCommand dbcmd)
    {
        FindObjects fo = new FindObjects();
        int         x  = 0;

        byte[] picbytes;
        string question = "";

        Texture2D[] tex = new Texture2D[2];



        dbcmd             = dbconn.CreateCommand();
        dbcmd.CommandText = SqlQuery(recordcount);
        SqliteDataReader reader = dbcmd.ExecuteReader();


        //okuma
        if (reader.HasRows == true)
        {
            while (reader.Read())
            {
                question   = reader.GetString(1);
                control[x] = reader.GetInt32(4);
                picbytes   = (byte[])reader["pic"];
                tex[x]     = new Texture2D(16, 16, TextureFormat.PVRTC_RGBA4, false);
                tex[x].LoadImage(picbytes);
                tex[x].Apply();
                x++;
            }
        }

        fo.findtexture(tex);
        fo.findtext(question);


        reader.Close();
        reader = null;

        if (recordcount == 1)
        {
            recordcount = getrecordcount(dbconn, dbcmd);
        }
        else
        {
            recordcount--;
        }
    }
Esempio n. 11
0
        private void PrintPool()
        {
            string label = GetComponent <GameText>().GetStringData(node,
                                                                   "Pool");

            if (board.CheckBlock(SubObjectTag.Pool,
                                 FindObjects.GetStaticActor(SubObjectTag.Examiner)
                                 .transform.position))
            {
                getUI(UITag.ExaminePoolLabel).text = label;
            }
            else
            {
                getUI(UITag.ExaminePoolLabel).text = "";
            }
        }
Esempio n. 12
0
 private void CheckBox_Checked(object sender, RoutedEventArgs e)
 {
     if (((Element)((CheckBox)sender).DataContext).type == "file")
     {
         CheckedElements.Add((Element)((CheckBox)sender).DataContext);
     }
     else
     {
         var files = FindObjects.FindFiles(((Element)((CheckBox)sender).DataContext).path);
         foreach (var t in files)
         {
             CheckedElements.Add(t);
             CheckedElements[CheckedElements.Count - 1].isSelected = true;
         }
         Folders((((Element)((CheckBox)sender).DataContext).path));
     }
 }
Esempio n. 13
0
            private void Search(SerializedProperty property)
            {
                FindObjects instance       = (FindObjects)attribute;
                var         nestedProperty = property.propertyPath.Split('.');
                string      findObjectName = instance.objectName;

                // ネストされたプロパティが3以上のときは
                // 配列の可能性があるので
                if (nestedProperty.Length >= 3)
                {
                    StringBuilder builder = new StringBuilder();
                    for (int i = 0; i < nestedProperty.Length - 2; ++i)
                    {
                        builder.Append(nestedProperty[i]);

                        if (i + 1 != nestedProperty.Length - 2)
                        {
                            builder.Append('.');
                        }
                    }

                    // ここでvectorだと配列と判定
                    if (property.serializedObject.FindProperty(builder.ToString()).type == "vector")
                    {
                        var contentMatchPattern = Regex.Match(nestedProperty[nestedProperty.Length - 1], "data\\[([0-9]+)\\]");
                        var currentIndex        = contentMatchPattern.Groups[1];
                        if (contentMatchPattern.Success)
                        {
                            findObjectName = string.Format(findObjectName, currentIndex);
                        }
                    }
                }

                GameObject target = GameObject.Find(findObjectName);

                if (target != null)
                {
                    property.objectReferenceValue = target;
                }
                else
                {
                    UnityEngine.Debug.LogErrorFormat("not found object : {0}", findObjectName);
                }
            }
Esempio n. 14
0
        public static NetworkManager GetNetworkManager(bool createMissing = false)
        {
            if (MasterNetAdapter.NetLib != NetworkLibrary.UNET)
            {
                return(null);
            }

            if (NetworkManager.singleton == null)
            {
                List <NetworkManager> found = FindObjects.FindObjectsOfTypeAllInScene <NetworkManager>();

                if (found.Count > 0)
                {
                    NetworkManager.singleton = found[0];
                }

                else if (createMissing)
                {
                    DebugX.LogWarning(!DebugX.logWarnings ? null : ("No NetworkManager in scene. Adding one now."));

                    GameObject nmGo = GameObject.Find("Network Manager");

                    if (nmGo == null)
                    {
                        nmGo = new GameObject("Network Manager");
                    }

                    NetworkManager.singleton = nmGo.AddComponent <NetworkManager>();

                    // If we are creating a missing NM, also create a HUD in case user wants that.
                    NetworkManagerHUD hud = nmGo.GetComponent <NetworkManagerHUD>();

                    if (!hud)
                    {
                        nmGo.AddComponent <NetworkManagerHUD>();
                    }

                    // Copy the playerprefab over from pun if it exists.
                }
            }

            return(NetworkManager.singleton);
        }
Esempio n. 15
0
        private void Button_SearchShow(object sender, RoutedEventArgs e)
        {
            Filter.search    = Search.Text;
            Filter.search_in = (bool)Searchin.IsChecked;
            try
            {
                Filter.SizeFrom = int.Parse(SizeFrom.Text);
                Filter.SizeTo   = int.Parse(SizeTo.Text);

                Filter.SizeType = SizeType.SelectedItem.ToString();
            }
            catch { }
            try
            {
                Filter.CreationDateFrom = (DateTime)CreationDateFrom.SelectedDate;
                Filter.CreationDateTo   = (DateTime)CreationDateTo.SelectedDate;
            }
            catch { }
            try
            {
                Filter.ChangeDateFrom = (DateTime)ChangeDateFrom.SelectedDate;
                Filter.ChangeDateTo   = (DateTime)ChangeDateTo.SelectedDate;
            }
            catch { }
            ElementList.ItemsSource       = FindObjects.Search(Filter, currentPath);
            CurrDir.Text                  = "Поиск";
            Search.Text                   = "";
            Searchin.IsChecked            = false;
            CreationDateFrom.SelectedDate = null;
            ChangeDateFrom.SelectedDate   = null;
            SizeFrom.Text                 = "";
            CreationDateTo.SelectedDate   = null;
            ChangeDateTo.SelectedDate     = null;
            SizeTo.Text                   = "";
            SizeType.SelectedItem         = defaultSize;
            Filter = new filter();
            this.Show();
        }
Esempio n. 16
0
 public void Setup()
 {
     findObjects = new FindObjects();
 }
Esempio n. 17
0
        public void Setup()
        {
            GlobalReference.GlobalValues = new GlobalValues();

            findObjects = new FindObjects();
        }
Esempio n. 18
0
        public static NetworkManager GetNetworkManager(bool createMissing = false)
        {
            if (MasterNetAdapter.NetLib != NetworkLibrary.UNET)
            {
                return(null);
            }

            if (NetworkManager.singleton == null)
            {
#if MIRROR
                List <NetworkManager> mirrorNM = FindObjects.FindObjectsOfTypeAllInScene <Mirror.NetworkManager>();
                if (mirrorNM.Count > 0)
                {
                    return(mirrorNM[0]);
                }
#endif

                List <NetworkManager> found = FindObjects.FindObjectsOfTypeAllInScene <NetworkManager>();

                if (found.Count > 0)
                {
                    NetworkManager.singleton = found[0];
                }

                else if (createMissing)
                {
                    Debug.Log("<b>Adding Network Manager</b>");
                    XDebug.LogWarning(!XDebug.logWarnings ? null : ("No NetworkManager in scene. Adding one now."));

                    GameObject nmGo = GameObject.Find("Network Manager");

                    if (nmGo == null)
                    {
                        nmGo = new GameObject("Network Manager");
                    }

                    NetworkManager.singleton = nmGo.AddComponent <NetworkManager>();

                    // If we are creating a missing NM, also create a HUD in case user wants that.
                    NetworkManagerHUD hud = nmGo.GetComponent <NetworkManagerHUD>();

                    if (!hud)
                    {
                        nmGo.AddComponent <NetworkManagerHUD>();
                    }

                    // Copy the playerprefab over from pun if it exists.

                    //#if MIRROR
                    //					var unetHUD = nmGo.GetComponent<UnityEngine.Networking.NetworkManagerHUD>();
                    //					if (unetHUD)
                    //						Object.DestroyImmediate(unetHUD);

                    //					var unetNM = nmGo.GetComponent<UnityEngine.Networking.NetworkManager>();
                    //					if (unetNM)
                    //						Object.DestroyImmediate(unetNM);

                    //#endif
                }
            }

            return(NetworkManager.singleton);
        }
Esempio n. 19
0
 private void FindCirclesHandler()
 {
     Spots = FindObjects.Circles(SelectedImgList.ImageMat).ToObservableCollection();
 }