Esempio n. 1
0
        private void Awake()
        {
            this.targetObjects      = this.GetComponent <PlaybackerCommon>().targetObjects;
            this.changeModeDropdown = this.GetComponent <PlaybackerCommon>().changeModeDropdown;
            this.resetObjectsButton = this.GetComponent <PlaybackerCommon>().resetObjectsButton;

            this.playButtonText = this.playButton.GetComponentInChildren <Text>();

            this.inputFilePathInputField = this.textSettings.GetComponentInChildren <InputField>();

            this.uniqueIdInputField  = this.databaseSettings.transform.Find("UniqueIdInputField").GetComponent <InputField>();
            this.mysqlIpInputField   = this.databaseSettings.transform.Find("IpInputField").GetComponent <InputField>();
            this.mysqlPortInputField = this.databaseSettings.transform.Find("PortInputField").GetComponent <InputField>();
            this.mysqlUserInputField = this.databaseSettings.transform.Find("UserInputField").GetComponent <InputField>();
            this.mysqlPassInputField = this.databaseSettings.transform.Find("PassInputField").GetComponent <InputField>();

            this.ChangeModeDropdownValueChanged(this.changeModeDropdown);

            foreach (GameObject targetObj in targetObjects)
            {
                Transform[] transforms = targetObj.transform.GetComponentsInChildren <Transform>(true);

                foreach (Transform transform in transforms)
                {
                    this.targetObjectsPathMap.Add(PlaybackerCommon.GetLinkPath(transform), transform);
                }
            }
        }
Esempio n. 2
0
        private void StartRecording()
        {
            SIGVerseLogger.Info("Recorder : Initialise");

            this.DisableSettings();

            DateTime dateTime = DateTime.Now;

            this.targetTransformInstances = new List <Transform>();

            List <string> linkPathList = new List <string>();                   // It is for only duplication check

            // Make header line
            this.savedHeaderStrings = string.Empty;

            this.savedHeaderStrings += "0.0," + PlaybackerCommon.TypeDef;                     // Elapsed time is dummy.

            // Create targets transform list
            foreach (GameObject targetObj in targetObjects)
            {
                Transform[] transforms = targetObj.transform.GetComponentsInChildren <Transform>();

                foreach (Transform transform in transforms)
                {
                    // Save Transform instance list
                    this.targetTransformInstances.Add(transform);

                    string linkPath = PlaybackerCommon.GetLinkPath(transform);

                    // Make a header line
                    this.savedHeaderStrings += "\t" + linkPath;

                    // Duplication check
                    if (linkPathList.Contains(linkPath))
                    {
                        SIGVerseLogger.Error("Objects in the same path exist. path=" + linkPath);
                        throw new Exception("Objects in the same path exist.");
                    }

                    linkPathList.Add(linkPath);
                }
            }

            if (this.modeType == ModeType.TextRecorder)
            {
                this.InitializeText();
            }
            else
            {
#if SIGVERSE_MYSQL
                this.InitializeDatabase();
#endif
            }

            this.savedMotionStrings = new List <string>();

            // Change Buttons
            this.recordButtonText.text = PlaybackerCommon.ButtonTextStop;

            // Reset elapsed time
            this.elapsedTime          = 0.0f;
            this.previousRecordedTime = 0.0f;


            SIGVerseLogger.Info("Recorder : Recording start.");

            this.statusText.text = StatusTextRecording;

            this.isRecording = true;
        }