/// <summary>
        /// 创建实验信息配置文件
        /// </summary>
        public void CreateExpInfoSettingsAsset()
        {
            ExperimentInfoSettings instanceField = ScriptableObject.CreateInstance <ExperimentInfoSettings>();

            AssetDatabase.CreateAsset(instanceField, ExpInfoSettingsAssetPath);
            ExpInfoSettings = instanceField;
        }
 private void OnEnable()
 {
     //从磁盘加载
     ExpInfoSettings = (ExperimentInfoSettings)AssetDatabase.LoadAssetAtPath(ExpInfoSettingsAssetPath, typeof(ExperimentInfoSettings));
     if (ExpInfoSettings == null)
     {
         //生成一份
         CreateExpInfoSettingsAsset();
     }
 }
        /// <summary>
        /// Unity Method
        /// </summary>
        void Start()
        {
            InjectService.InjectInto(this);
            //赋初值
            username = userInput.text;
            password = passInput.text;

            userInput.onValueChanged.AddListener(p => username = p);
            passInput.onValueChanged.AddListener(p => password = p);

            loginBtn.onClick.AddListener(LoginIn);

            _ExpInfoSettings = (ExperimentInfoSettings)Resources.Load("ExperimentInfoSettings", typeof(ExperimentInfoSettings));
        }
Example #4
0
        private void Start()
        {
            InjectService.InjectInto(this);
            ExperimentInfoSettings ExpInfoSettings = (ExperimentInfoSettings)Resources.Load("ExperimentInfoSettings", typeof(ExperimentInfoSettings));

            _labInterUrl.Add(LabInterType.login, ExpInfoSettings.loginUrl);
            _labInterUrl.Add(LabInterType.uploadIgcs, ExpInfoSettings.uploadIgcsUrl);
            _labInterUrl.Add(LabInterType.uploadRepay, ExpInfoSettings.uploadReplayUrl);
            _labInterUrl.Add(LabInterType.downloadReplay, ExpInfoSettings.downloadReplayUrl);


            //调用接口,获取登录用户信息
            //if (Application.platform == RuntimePlatform.WebGLPlayer)
            //{
            //    _iLabInterApiService.GetLabUserInfo();
            //}
        }