Exemple #1
0
        /// <summary>
        /// Called once on editor startup.
        /// Validate copied folders integrity in clone project
        /// </summary>
        static ValidateCopiedFoldersIntegrity()
        {
            if (!SessionState.GetBool(SessionStateKey, false))
            {
                SessionState.SetBool(SessionStateKey, true);
                if (!ClonesManager.IsClone())
                {
                    return;
                }

                ValidateFolder("Packages");
            }
        }
Exemple #2
0
        static void ValidateFolder(string folderName)
        {
            var currentProjectPath = Path.Combine(ClonesManager.GetCurrentProjectPath(), folderName);
            var currentFolderHash  = CreateMd5ForFolder(currentProjectPath);

            var originalProjectPath = Path.Combine(ClonesManager.GetOriginalProjectPath(), folderName);
            var originalFolderHash  = CreateMd5ForFolder(originalProjectPath);

            if (currentFolderHash != originalFolderHash)
            {
                Debug.Log("ParrelSync: Detected '" + folderName + "' folder changes in the original project. Updating...");
                FileUtil.ReplaceDirectory(originalProjectPath, currentProjectPath);
            }
        }
        // Start is called before the first frame update
        void Start()
        {
            // Is this editor instance running a clone project?
            if (ClonesManager.IsClone())
            {
                Debug.Log("This is a clone project.");

                //Argument can be set from the clones manager window.
                string customArgument = ClonesManager.GetArgument();
                Debug.Log("The custom argument of this clone project is: " + customArgument);
                // Do what ever you need with the argument string.
            }
            else
            {
                Debug.Log("This is the original project.");
            }
        }
Exemple #4
0
    private void SetUpInputField()
    {
        if (!PlayerPrefs.HasKey(PlayerPrefsNameKey))
        {
            return;
        }

        string defaultName = PlayerPrefs.GetString(PlayerPrefsNameKey);

        //dev only fix remove this if statement
        if (ClonesManager.GetArgument() != "")
        {
            print("asd");
            NameInputField.text = ClonesManager.GetArgument();
        }
        else
        {
            NameInputField.text = defaultName;
        }

        CheckNameValid(defaultName);
    }