Пример #1
0
        private void OnValidate()
        {
#if UNITY_EDITOR
            if (gameObject.scene.name != null && autoKey == "0")
            {
                //autoKey = BuscadorDeID.GetUniqueID(gameObject, autoKey);
                autoKey = GetInstanceID() + "_" + gameObject.scene.name + "_Bau";
                BuscadorDeID.SetUniqueIdProperty(this, autoKey, "autoKey");
            }
#endif
        }
Пример #2
0
        private void OnValidate()
        {
#if UNITY_EDITOR
            Event e   = Event.current;
            bool  foi = false;
            if (e != null)
            {
                foi = e.commandName == "Duplicate" || e.commandName == "Paste";
                Debug.Log(e.commandName);
            }

            if ((ID == "0" || foi) && gameObject.scene.name != null)
            {
                // ID = BuscadorDeID.GetUniqueID(gameObject, ID.ToString());

                ID = GetInstanceID() + "_" + gameObject.scene.name + "_Cristalx";
                //ID = System.Guid.NewGuid().ToString();
                BuscadorDeID.SetUniqueIdProperty(this, ID, "ID");
            }
#endif
        }