예제 #1
0
        /// <summary>
        /// Saves all currently loaded objects that are dirty to the database
        /// </summary>
        public void RunSaveCycle(string serverID)
        {
            if (m_StopSaving || 1 == Interlocked.Exchange(ref m_UpdatingSaveQueue, 1))
            {
                // Failed to get the lock.  Process is already/still running.
                return;
            }
            Interlocked.Exchange(ref m_SaveCycleScheduled, 0);

            DateTime start = DateTime.UtcNow;
            ICollection <IGameObject> items = AllObjects;
            string msg       = "";
            int    processed = DB.Instance.Item_BatchUpdate((List <IGameObject>)items, out msg, this);

            DateTime fin = DateTime.UtcNow;
            TimeSpan len = fin - start;

            Log1.Logger("Server").Info("Game object save cycle wrote  [" + processed.ToString() + " objects in " + len.ToString() + "]");
            Log1.Logger("Server").Info("Server is now tracking [" + ObjectCount.ToString() + " game objects].");

            StartSaveCycle(serverID, len.TotalMilliseconds > ConfigHelper.GetIntConfig("ItemSaveCycleTimerMs", 30000));

            // Release the lock
            Interlocked.Exchange(ref m_UpdatingSaveQueue, 0);
        }
예제 #2
0
 //Use this for initialization
 void Start()
 {
     Input.multiTouchEnabled = false;                                                 //マルチタッチを無効化
     this.CursorLock         = GameObject.Find("Mixer").GetComponent <ObjectCount>(); //ObjectCountスクリプトを取得
     this.FoodSE             = GetComponents <AudioSource>();
     this.FoodDropSE         = FoodSE[0];
     this.FoodGrabSE         = FoodSE[1];
 }
        public string[] ToList()
        {
            string[] properties = new string[4];

            properties[0] = $"Name: {Name}";
            properties[1] = $"Layer Count: {LayerCount.ToString()}";
            properties[2] = $"Object Count: {ObjectCount.ToString()}";
            properties[3] = $"Blockdefinition Count: {BlockDefinitionCount.ToString()}";

            return(properties);
        }
 void Start()
 {
     objectCountScript = Object.GetComponent <ObjectCount>();
     if (energy)
     {
         painelLigado.GetComponent <SpriteRenderer>().enabled = true;
     }
     else
     {
         painelDesligado.GetComponent <SpriteRenderer>().enabled = true;
     }
     //energy = gameManeger.eletricidade;
 }
예제 #5
0
 // Use this for initialization
 void Start()
 {
     CompletionButton = GetComponent <Button>();
     OB = GameObject.Find("Mixer").GetComponent <ObjectCount>();
 }
예제 #6
0
 /// <summary>
 /// Converts the value of the current <see cref="ReferenceManager" /> to its equivalent string representation.
 /// </summary>
 /// <returns>
 /// A string representation of the current <see cref="ReferenceManager" />.
 /// </returns>
 public override String ToString() => $"Object count: {ObjectCount.ToString()}";
예제 #7
0
    //public SaveScript save;

    // Use this for initialization
    void Start()
    {
        string a = SceneManager.GetActiveScene().name;

        if (a == "result")
        {
            TotalAmount = ObjectCount.getA();
            Debug.Log("TotalAmount = " + TotalAmount);
            str = SaveScript.getB();
        }

        GetPrefs();

        SetDefaultData();

        if (a == "result")
        {
            if (Topscore[0] < TotalAmount)
            {
                Debug.Log("1st");
                //スコア上書き
                Topscore[2] = Topscore[1];
                Topscore[1] = Topscore[0];
                Topscore[0] = TotalAmount;

                //名前上書き
                Topname[2] = Topname[1];
                Topname[1] = Topname[0];
                Topname[0] = "";

                Rank = 0;
            }
            else if (Topscore[1] < TotalAmount && Topscore[0] >= TotalAmount)
            {
                Debug.Log("2nd");
                //スコア上書き
                Topscore[2] = Topscore[1];
                Topscore[1] = TotalAmount;

                //名前上書き
                Topname[2] = Topname[1];
                Topname[1] = "";

                Rank = 1;
            }
            else if (Topscore[2] < TotalAmount && Topscore[1] >= TotalAmount)// 3位
            {
                Debug.Log("3rd");
                //スコア上書き
                Topscore[2] = TotalAmount;

                //名前上書き
                Topname[2] = "";

                Rank = 2;
            }
            else if (Topscore[2] >= TotalAmount)
            {
                SceneManager.LoadScene("Ranking");
                Debug.Log(Topscore[2]);
                Debug.Log(TotalAmount);
                Debug.Log("Scena_change");

                //Rank = 3;
            }
        }
    }