Example #1
0
        private INode GetGoogleNodeByNameAndParent(INode parent, string name)
        {
            Console.WriteLine($"Getting google data for '{parent.Name}'");

            INode result = null;

            Console.WriteLine($"Enumerating {parent.Children.Count()} children, looking for {name} folder");
            foreach (var child in parent.Children)
            {
                Console.Write(".");

                if (child.Name == name)
                {
                    var childData = GoogleManager.GetTree(child.Id);

                    AddToCache(childData, parent.Id);
                    Console.WriteLine();
                    Console.WriteLine($"{name} folder found");
                    result = childData;
                    break;
                }
            }

            if (result == null)
            {
                throw new ApplicationException($"No folder named '{name}' found in Google Drive {parent.Name}");
            }

            return(result);
        }
Example #2
0
 // 퀘스트 로드
 void QuestLoad(SavedGameRequestStatus status, ISavedGameMetadata game)
 {
     if (status == SavedGameRequestStatus.Success)
     {
         GoogleManager.SavedGame().ReadBinaryData(game, LoadQuestData);
     }
 }
Example #3
0
        public JsonResult GetContent(string Name)
        {
            GoogleManager mng = new GoogleManager();

            mng.Authentications();
            string[] res = mng.DownloadContentFile(Name);
            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Example #4
0
    void Start()
    {
        imgInfoObj = buildingInfoPanelObj.transform.GetChild(0).transform.GetChild(2).gameObject;

        txtNoticeObj.SetActive(false);

        googleManager = GameObject.FindObjectOfType <GoogleManager>();
    }
Example #5
0
    void Awake()
    {
        Instance = this;

        isInitialized = false;

        DontDestroyOnLoad(this);
    }
Example #6
0
    void Start()
    {
        uiManager     = GameObject.FindObjectOfType <UIManager>();
        optionManager = GameObject.FindObjectOfType <OptionManager>();
        googleManager = GameObject.FindObjectOfType <GoogleManager>();

        StartCoroutine(SetTime());
        StartCoroutine(AutoSave());
    }
 void Awake()
 {
     instance = this;
     if (loggin == false)
     {
         GoogleManager.instance.loggin = true;
         OnLogin();
     }
 }
Example #8
0
        public JsonResult DeletFiles(string name)
        {
            GoogleManager mng = new GoogleManager();

            mng.Authentications();
            bool res = mng.DeleteFiles(name);

            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Example #9
0
        // GET: GoogleDrive
        public ActionResult Index()
        {
            GoogleManager mng = new GoogleManager();

            mng.Authentications();
            List <string> title = mng.GetFiles();

            ViewBag.name = title;
            return(View());
        }
Example #10
0
        public JsonResult EditDoc(MitemEditModel json)
        {
            string        content = json.theHtml;
            string        idFile  = json.idFile;
            GoogleManager mng     = new GoogleManager();

            mng.Authentications();
            bool res = mng.UpdataDocument(idFile, content);

            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Example #11
0
        public JsonResult CreateDoc(MItemtModel jsonObject)
        {
            string        text  = jsonObject.theHtml;
            string        title = jsonObject.title;
            GoogleManager mng   = new GoogleManager();

            mng.Authentications();
            bool res = mng.CreateDocument(title, text);

            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Example #12
0
        // Called when the player died
        public void GameOver()
        {
            GameState = GameState.GameOver;
            GameCount++;
            if (GameCount % 5 == 0)
            {
                //UnityAds.instance.ShowAd();
            }
            GoogleManager.ReportScore();


            StartCoroutine(CRStopMusic(1f));
        }
Example #13
0
        private INode LoadGoogleBackupsFolder(string parentId = "root", string folderName = "tst")
        {
            Console.WriteLine("Searching for first AKA root level stuff");
            var cachedId = GetFromCache(folderName, parentId);

            if (!String.IsNullOrEmpty(cachedId))
            {
                return(GoogleManager.GetTree(cachedId));
            }

            Console.WriteLine($"No saved data about {folderName} folder");
            var parent = GoogleManager.GetTree(parentId);

            var node = GetGoogleNodeByNameAndParent(parent, folderName);

            Console.WriteLine($"{folderName} loaded");
            AddToCache(node, parentId);
            return(node);
        }
    // Start is called before the first frame update
    void Awake()
    {
        //PlayerPrefs.DeleteAll();

        if (Instance == null)
        {
            Instance = this;
        }

        //구글 서비스 활성화
#if UNITY_ANDROID
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
                                              .EnableSavedGames()
                                              .Build();
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();
#elif UNITY_IOS
        GameCenterPlatform.ShowDefaultAchievementCompletionBanner(true);
#endif
    }
Example #15
0
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            DestroyImmediate(this);
        }

        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
                                              // enables saving game progress.
                                              .EnableSavedGames()
                                              .Build();

        PlayGamesPlatform.InitializeInstance(config);

        PlayGamesPlatform.DebugLogEnabled = false;
        PlayGamesPlatform.Activate();
    }
    void Start()
    {
        scenarioHandlerRef = this.GetComponent<ScenarioHandler>();

        if (bQuestionnaireEnabled)
        {
            googleManager = this.GetComponent<GoogleManager>();
            playerRef = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();

            answersList = new Dictionary<string,string>();
            questionsList = new Dictionary<string,string>();
            helperTextList = new Dictionary<string, string>();

            FindAllQuestions();

            lastPage = scenarioHandlerRef.GetScenarioCount()+1;

            lastPage++;
            likertAnswers = new int[lastPage];
            wantBuildAnswers = new string[lastPage];
            commentAnswers = new string[lastPage];

            for (int i = 0; i < lastPage; i++)
            {
                likertAnswers[i] = 0;
                wantBuildAnswers[i] = "";
                commentAnswers[i] = "";
            }
            lastPage--;

            float screenWidth = Screen.width * 0.95f,
                screenHeight = Screen.height * 0.90f;
            qWidth = (screenWidth > qWidth) ? screenWidth : qWidth;
            qHeight = (screenHeight > qHeight) ? screenHeight : qHeight;

            questionnaireRect = new Rect((Screen.width/2f) - (qWidth/2f), (Screen.height/2f) - (qHeight/2f), qWidth, qHeight);

            windowStyle.normal.background = MakeColorTexture((int)qWidth+1, (int)qHeight+1, Color.black);
        }
    }
Example #17
0
 void GameOver()
 {
     GameState = GameState.GameOver;
     AppsFlyerMMP.Score(ScoreManager.Instance.Score);
     GoogleManager.ReportScore();
 }
Example #18
0
 public GoogleController(IUnitOfWorkAsync unitOfWorkAsync) : base(unitOfWorkAsync)
 {
     google = new GoogleManager(key, engine);
 }
Example #19
0
 // 클라우드 데이터 로드
 public void LoadCloud()
 {
     GoogleManager.SavedGame().OpenWithAutomaticConflictResolution("buildingsave", DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLastKnownGood, BuildingLoad);
     GoogleManager.SavedGame().OpenWithAutomaticConflictResolution("questsave", DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLastKnownGood, QuestLoad);
     GoogleManager.SavedGame().OpenWithAutomaticConflictResolution("resourcesave", DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLastKnownGood, ResourceLoad);
 }
Example #20
0
 //저장된 게임 체크 (처음이면 도시이름 짓기 On)
 void SavedGameCheck()
 {
     GoogleManager.SavedGame().OpenWithAutomaticConflictResolution("resourcesave", DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLongestPlaytime, CityNamePanelOn);
 }