private void OnClickFinishPrev(HUDTextButton sender, HUDButtonEventArgs args) { if (UnlockManager.IsUnlocked(Levels.WORLD_001, false) != WorldUnlockState.OpenAndUnlocked) { MainGame.Inst.SetTutorialLevelScreen(); return; } if (UnlockManager.IsUnlocked(Levels.WORLD_002, false) != WorldUnlockState.OpenAndUnlocked) { MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLD_001); return; } if (UnlockManager.IsUnlocked(Levels.WORLD_003, false) != WorldUnlockState.OpenAndUnlocked) { MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLD_002); return; } if (UnlockManager.IsUnlocked(Levels.WORLD_004, false) != WorldUnlockState.OpenAndUnlocked) { MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLD_003); return; } MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLD_004); }
protected override void OnClick(GameEntityMouseArea area, SAMTime gameTime, InputState istate) { #if DEBUG if (DebugSettings.Get("UnlockNode")) { OnClickUnlocked(); return; } if (DebugSettings.Get("WorldPreview")) { MainGame.Inst.Profile.PurchasedWorlds.Clear(); ShowPreview(); return; } #endif _ustate = UnlockManager.IsUnlocked(Blueprint, true); if (_ustate == WorldUnlockState.Unlocked) { OnClickUnlocked(); } else if (_ustate == WorldUnlockState.NeedsAction) { OnClickNeedsAction(); } else if (_ustate == WorldUnlockState.FullyLocked) { OnClickFullyLocked(); } }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); return; } _highestCompletedLevel = PlayerPrefs.GetInt("LevelsCompleted"); for (int i = 0; i < _highestCompletedLevel; i++) { _maps[i]._completed = true; } for (int i = 0; i < _highestCompletedLevel + 1; i++) { _maps[i]._locked = false; } for (int i = 0; i < _maps.Count; i++) { _maps[i]._highscore = PlayerPrefs.GetInt("highScoresList_" + i); Debug.Log(_maps[i]._highscore); } }
public void Init() { this.detailView.gameObject.SetActive(false); // 이전에 있던 Element 반환 for (int i = 0; i < this.elements.Count; i++) { ObjectPoolManager.inst.Return(this.elements[i].gameObject); } this.elements.Clear(); // 던전 리스트를 받아온다. for (int i = 0; i < DungeonDatabase.info.Length; i++) { // 선행조건을 만족하지 않았다면 제외 if (!UnlockManager.IsUnlock(DungeonDatabase.info[i].preKey)) { continue; } var element = ObjectPoolManager.inst.Get <DungeonUI_Element>(PrefabPath.UI.DungeonUI_Element); element.transform.SetParent(this.scrollRect.content, false); (element.transform as RectTransform).anchoredPosition3D = Vector3.zero; element.transform.localRotation = Quaternion.identity; element.transform.localScale = Vector3.one; element.Init(this, DungeonDatabase.info[i].dungeonKey, DungeonDatabase.info[i].title); this.elements.Add(element); } }
public WorldPreviewPanel(LevelBlueprint[] bps, Guid unlockID, string iab, int worldnumber) { _blueprints = bps; _id = unlockID; _iabCode = iab; _worldNumber = worldnumber; RelativePosition = FPoint.Zero; Size = new FSize(WIDTH, HEIGHT); Alignment = HUDAlignment.CENTER; Background = FlatColors.Asbestos; _unlockWorldNumber = 1; if (UnlockManager.IsUnlocked(Levels.WORLD_001, false) != WorldUnlockState.Unlocked) { _unlockWorldNumber = 0; } else { if (_worldNumber > 2 && UnlockManager.IsUnlocked(Levels.WORLD_002, false) == WorldUnlockState.Unlocked) { _unlockWorldNumber = 2; } if (_worldNumber > 3 && UnlockManager.IsUnlocked(Levels.WORLD_003, false) == WorldUnlockState.Unlocked) { _unlockWorldNumber = 3; } if (_worldNumber > 4 && UnlockManager.IsUnlocked(Levels.WORLD_004, false) == WorldUnlockState.Unlocked) { _unlockWorldNumber = 4; } } }
IEnumerator read_unlock_when_ready(GameObject dummy) { IsReadingSaveData = true; //ManagerManager.Manager.mDebugString = "save, can start state: " + mManager.mZigManager.ZgInterface.can_start(); while (!mManager.mZigManager.ZgInterface.can_start()) { yield return(null); } ManagerManager.Log("starting save thread"); mManager.mZigManager.ZgInterface.read_data("unlock", delegate(byte[] obj){ ManagerManager.Log("received save data " + obj); if (obj != null) { ManagerManager.Log("length " + obj.Length); UnlockManager.deserialize(obj); } SaveDataRead = true; if (ManagerManager.Manager.mTransitionCameraManager.IsInitialized) { ManagerManager.Log("setting char transparencies"); ManagerManager.Manager.mTransitionCameraManager.set_start_screen_character_transparency(); } IsReadingSaveData = false; } ); GameObject.Destroy(dummy); }
public static UnlockManager GetInstance() { if (instance == null) { instance = FindObjectOfType <UnlockManager>(); } return(instance); }
public MultiplayerMainPanel() { RelativePosition = FPoint.Zero; Size = new FSize(WIDTH, HEIGHT); Alignment = HUDAlignment.CENTER; Background = FlatColors.BackgroundHUD; _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_MULTIPLAYER, true); }
public GDGameScreen_SP(MainGame game, GraphicsDeviceManager gdm, LevelBlueprint bp, FractionDifficulty diff, GraphBlueprint ws) : base(game, gdm, bp, diff, false, false, diff == FractionDifficulty.DIFF_0 && bp.UniqueID == Levels.LEVELID_1_1) { WorldBlueprint = ws; GameSpeedMode = MainGame.Inst.Profile.SingleplayerGameSpeed; UpdateGameSpeed(); _unlocksBefore = UnlockManager.GetFullUnlockState().ToList(); }
// Thread: Main public override void OnRefreshMilestones() { if (Singleton <SimulationManager> .instance.m_metaData.m_updateMode == SimulationManager.UpdateMode.NewGame) { // only do once if (!unlockedAreas) { IAreas AreasManager = Managers.areas; // calculate original cash long originalCash = EconomyManager.instance.InternalCashAmount; // causes rendering issue in new areas Singleton <UnlockManager> .instance.UnlockAllProgressionMilestones(); // unlock all tiles int rows = (int)Math.Sqrt(AreasManager.maxAreaCount); for (int x = 0; x < rows; x++) { for (int y = 0; y < rows; y++) { int column = x; int row = y; if (rows.Equals(3)) { column = x + 1; row = y + 1; } if (!AreasManager.IsAreaUnlocked(column, row) && AreasManager.CanUnlockArea(column, row)) { AreasManager.UnlockArea(column, row, false); } } } // copy milestone info so we can reset it to default MilestoneInfo[] MilestoneInfos = new MilestoneInfo[UnlockManager.instance.m_allMilestones.Count]; UnlockManager.instance.m_allMilestones.Values.CopyTo(MilestoneInfos, 0); UnlockManager.ResetMilestones(MilestoneInfos, false); // calculated added cash long finalCash = EconomyManager.instance.InternalCashAmount; int cashDifference = Convert.ToInt32(originalCash - finalCash); // remove cash difference EconomyManager.instance.AddResource(EconomyManager.Resource.LoanAmount, cashDifference, ItemClass.Service.None, ItemClass.SubService.None, ItemClass.Level.None); } } unlockedAreas = true; }
public MultiplayerMainPanel() { RelativePosition = FPoint.Zero; Size = new FSize(WIDTH, HEIGHT); Alignment = HUDAlignment.CENTER; Background = FlatColors.BackgroundHUD; _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_MULTIPLAYER, true); //MainGame.Inst.GDBridge.IAB.SynchronizePurchases(GDConstants.IABList); }
/// <summary> /// 初期化 /// </summary> private void Initialize() { controllerManager = new ControllerManager(); soundManager = transform.GetChild(0).GetComponent <SoundManager>(); systemSeManager = transform.GetChild(0).GetComponent <SystemSE>(); sceneManager = new SceneChange(); stageManager = new StageManager(); stageManager.Initialize(0, true); //Debug Test unlockStageManager = new UnlockManager(); saveManager = new SaveManager(); saveManager.Load(unlockStageManager); //Load }
// Use this for initialization void Start() { index = 0; vManager = GameObject.Find("Manager").GetComponent <VerificationManager>(); uManager = GameObject.Find("Manager").GetComponent <UnlockManager>(); nManager = GameObject.Find("Manager").GetComponent <NodeManager>(); current_text = new List <Text>(); lesson_text = new List <Text>(); LoadLevel(0); }
/// <summary> /// 保存 /// </summary> public void Save(UnlockManager unlockManager) { if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } if (File.Exists(path + fileName)) //Dataある場合 { SaveData(unlockManager, FileMode.Open); return; } SaveData(unlockManager, FileMode.CreateNew); }
public OverworldNode_SCCM(GDOverworldScreen scrn, FPoint pos) : base(scrn, pos, L10NImpl.STR_WORLD_ONLINE, Levels.WORLD_ID_ONLINE) { AddOperationDelayed(new TetrisInitialOperation(0.50f), 0.75f); AddOperation(new CyclicSequenceOperation <OverworldNode_SCCM>( new SleepOperation <OverworldNode_SCCM>(1.50f), new TetrisFillOperation(5.50f), new SleepOperation <OverworldNode_SCCM>(0.75f), new TetrisBlendOperation(0.75f), new SleepOperation <OverworldNode_SCCM>(0.25f), new TetrisShrinkOperation(2.50f))); _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_ONLINE, false); }
// Start is called before the first frame update void Start() { t1 = b1.GetComponentInChildren <Text>(); t2 = b2.GetComponentInChildren <Text>(); t3 = b3.GetComponentInChildren <Text>(); t4 = b4.GetComponentInChildren <Text>(); t5 = b5.GetComponentInChildren <Text>(); player = GameObject.FindGameObjectWithTag("Player"); controller = player.GetComponent <PlayerController>(); unlocks = ManagerSingleton.Instance.unlocks; ResetText(); }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(this.gameObject); } data = gameObject.GetComponent <DataManager>(); unlocks = gameObject.GetComponent <UnlockManager>(); }
private void OnClickFinishPrev(HUDTextButton sender, HUDButtonEventArgs args) { if (_unlockWorldNumber == 0) { MainGame.Inst.SetTutorialLevelScreen(); return; } int missPoints = UnlockManager.PointsForUnlock(_id) - MainGame.Inst.Profile.TotalPoints; HUD.ShowToast("WPP::HINT", L10N.TF(L10NImpl.STR_PREV_MISS_TOAST, missPoints, _worldNumber), 32, FlatColors.Orange, FlatColors.Foreground, 4f); MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLDS_BY_NUMBER[_unlockWorldNumber]); }
protected OverworldNode_Graph(GDOverworldScreen scrn, FPoint pos, GraphBlueprint world, string iab) : base(scrn, pos, Levels.WORLD_NAMES[world.ID], world.ID) { Blueprint = world; IABCode = iab; solvedPerc[FractionDifficulty.DIFF_0] = GetSolvePercentage(FractionDifficulty.DIFF_0); solvedPerc[FractionDifficulty.DIFF_1] = GetSolvePercentage(FractionDifficulty.DIFF_1); solvedPerc[FractionDifficulty.DIFF_2] = GetSolvePercentage(FractionDifficulty.DIFF_2); solvedPerc[FractionDifficulty.DIFF_3] = GetSolvePercentage(FractionDifficulty.DIFF_3); _swingPeriode *= FloatMath.GetRangedRandom(0.85f, 1.15f); _ustate = UnlockManager.IsUnlocked(world, false); }
void Start() { itemDescriptionText = GameObject.Find("ItemDescriptionText").GetComponent <Text>(); itemDescriptionText.text = ""; /*Scale*/ animLB[0] = new AnimationCurve(new Keyframe(0, 9.0f), new Keyframe(fTimeToBurst, 8.0f), new Keyframe(fTimeToBurst + 1.0f, 7000.0f)); /* Yaw */ animLB[1] = new AnimationCurve(new Keyframe(0, 175), new Keyframe(1, 185)); animLB[0].postWrapMode = WrapMode.ClampForever; animLB[1].postWrapMode = WrapMode.PingPong; lootbox = Instantiate(Resources.Load <GameObject>("Prefabs/lootbox"), Vector3.zero, rotation, transform); lootbox.transform.localScale = new Vector3(animLB[0].Evaluate(Time.timeSinceLevelLoad), animLB[0].Evaluate(Time.timeSinceLevelLoad), animLB[0].Evaluate(Time.timeSinceLevelLoad)); UnlockManager um = GameObject.Find("UnlockManager").GetComponent <UnlockManager>(); Unlockable newItem = um.UnlockRandom(); if (newItem == null) { //SceneManager.LoadScene("GameOverScene"); //return; newItem = Coins.GetComponent <Unlockable>(); } { GameObject prefab = newItem.gameObject; newItemDisplay = Instantiate(prefab, Vector3.zero, rotation, transform); newItemDisplay.transform.localScale = Vector3.zero; } Keyframe kf2; fTimeToFullSize = fTimeToBurst + 0.8f; if (newItemDisplay.GetComponent <Unlockable>().type == UnlockableType.SKYSCRAPER) { kf2 = new Keyframe(fTimeToFullSize, 0.3f); } else if (newItemDisplay.GetComponent <Unlockable>().type == UnlockableType.HOUSE || newItemDisplay.GetComponent <Unlockable>().type == UnlockableType.SHOP) { kf2 = new Keyframe(fTimeToFullSize, 0.65f); } else { kf2 = new Keyframe(fTimeToFullSize, 1.5f); } animNID = new AnimationCurve(new Keyframe(0, 0), new Keyframe(fTimeToBurst, 0), kf2); animNID.postWrapMode = WrapMode.ClampForever; }
/// <summary> /// 上書き /// </summary> private void SaveData(UnlockManager unlockManager, FileMode mode) { FileStream fs = new FileStream(path + fileName, mode); StreamWriter sw = new StreamWriter(fs); int stageCount = (int)EScene.StageNull; //stage数 for (int i = 1; i < stageCount; ++i) { string saveString = unlockManager.SaveString(i); //Saveの文字列を取得 sw.WriteLine(saveString); //Save } sw.Close(); //終了処理 fs.Close(); //終了処理 }
/// <summary> /// ロード /// </summary> public void Load(UnlockManager unlockManager) { if (!File.Exists(path + fileName)) //存在しなかったら戻る { return; } FileStream fs = new FileStream(path + fileName, FileMode.Open); StreamReader sr = new StreamReader(fs); while (!sr.EndOfStream) { unlockManager.Load(sr.ReadLine()); //ロード処理 } sr.Close(); //終了処理 fs.Close(); //終了処理 }
// Use this for initialization void Start() { um = GameObject.Find("UnlockManager").GetComponent <UnlockManager>(); _itemNameText = GameObject.Find("ItemNameText").GetComponent <Text>(); _itemCostText = GameObject.Find("ItemPriceText").GetComponent <Text>(); _itemDescriptionText = GameObject.Find("ItemDescriptionText").GetComponent <Text>(); _currentCoinsText = GameObject.Find("CurrentCoinsText").GetComponent <Text>(); _itemNameText.text = ""; _itemCostText.text = "Price: -"; _currentCoinsText.text = "Coins: " + Currency.GetCurrency(); purchaseButton = GameObject.Find("Purchase").GetComponent <Button>(); purchaseButton.onClick.AddListener(onPurchaseClick); RefreshItems(); }
// Start is called before the first frame update void Start() { playerLayerMask = LayerMask.NameToLayer("Player"); enemyLayerMask = LayerMask.NameToLayer("Enemy"); rigid = this.GetComponent <Rigidbody2D>(); trans = this.GetComponent <Transform>(); hitbox = this.GetComponent <Collider2D>(); playerSprite = this.GetComponent <SpriteRenderer>(); anim = this.GetComponent <Animator>(); data = ManagerSingleton.Instance.data; unlocks = ManagerSingleton.Instance.unlocks; dashVelocity = new Vector2(dashSpeed, 0); dashVelocityLeft = new Vector2(-dashSpeed, 0); originalGravityScale = rigid.gravityScale; wallJumpDirection.Normalize(); }
void Start() { if (instance != null) { Destroy(gameObject); return; } instance = this; DontDestroyOnLoad(gameObject); Init(); if (!PlayerPrefs.HasKey("adCountdown")) { int nextAdCountdown = 0; PlayerPrefs.SetInt("adCountdown", nextAdCountdown); PlayerPrefs.Save(); } }
protected override void OnClick(GameEntityMouseArea area, SAMTime gameTime, InputState istate) { var ownr = ((GDOverworldScreen)Owner); if (ownr.IsTransitioning) { return; } if (MainGame.Inst.Profile.AccountType == AccountType.Local) { MainGame.Inst.ShowToast(null, L10N.T(L10NImpl.STR_MP_CONNECTING), 40, FlatColors.Emerald, FlatColors.Foreground, 2f); MainGame.Inst.Backend.CreateUser(MainGame.Inst.Profile).RunAsync(); return; } //MainGame.Inst.GDBridge.IAB.SynchronizePurchases(GDConstants.IABList); var ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_ONLINE, true); switch (ustate) { case WorldUnlockState.OpenAndUnlocked: Owner.HUD.AddModal(new SCCMMainPanel(), true, 0.5f, 1f); break; case WorldUnlockState.ReachableButMustBePreviewed: case WorldUnlockState.UnreachableButCanBePreviewed: Owner.HUD.AddModal(new SCCMPreviewPanel(), true, 0.5f, 1f); break; case WorldUnlockState.UnreachableAndFullyLocked: Owner.HUD.ShowToast("ONSCCM::LOCKED(MULTI)", L10N.T(L10NImpl.STR_GLOB_WORLDLOCK), 40, FlatColors.Pomegranate, FlatColors.Foreground, 1.5f); MainGame.Inst.GDSound.PlayEffectError(); AddOperation(new ShakeNodeOperation()); break; default: SAMLog.Error("ONSCCM::EnumSwitch_OC", "ustate: " + ustate); throw new ArgumentOutOfRangeException(); } }
private void OnClick(GameEntityMouseArea sender, SAMTime gameTime, InputState istate) { if (GDOwner.ZoomState != BistateProgress.Normal && GDOwner.ZoomState != BistateProgress.Expanded) { return; } #if DEBUG if (!NodeEnabled && DebugSettings.Get("UnlockNode")) { NodeEnabled = true; } #endif if (!NodeEnabled) { MainGame.Inst.GDSound.PlayEffectError(); if (GDOwner.ZoomState == BistateProgress.Expanded) { AddEntityOperation(new ScreenShakeOperation2(this, GDOwner)); } else { AddEntityOperation(new ScreenShakeAndCenterOperation2(this, GDOwner)); } Owner.HUD.ShowToast("WN::LOCKED", L10N.T(L10NImpl.STR_GLOB_WORLDLOCK), 40, FlatColors.Pomegranate, FlatColors.Foreground, 1.5f); return; } if (UnlockManager.IsUnlocked(Blueprint.TargetWorld, true) == WorldUnlockState.OpenAndUnlocked) { Owner.AddAgent(new LeaveTransitionWorldMapAgent(GDOwner, GDOwner.ZoomState == BistateProgress.Expanded, this, Target)); MainGame.Inst.GDSound.PlayEffectZoomOut(); } else { Owner.AddAgent(new LeaveTransitionOverworldAgent(GDOwner, GDOwner.ZoomState == BistateProgress.Expanded)); MainGame.Inst.GDSound.PlayEffectZoomOut(); } }
protected override void DoUpdate(SAMTime gameTime, InputState istate) { base.DoUpdate(gameTime, istate); if (!Alive) { return; } if (_ustate != WorldUnlockState.OpenAndUnlocked) { _ustate = UnlockManager.IsUnlocked(Levels.WORLD_ID_MULTIPLAYER, false); if (_ustate == WorldUnlockState.OpenAndUnlocked) { Remove(); Owner.HUD.AddModal(new MultiplayerMainPanel(), true, 0.5f); } } }
public override void ShowScorePanel(LevelBlueprint lvl, PlayerProfile profile, HashSet <FractionDifficulty> newDifficulties, bool playerHasWon, int addPoints, int time) { ((GDGameHUD)HUD).BtnPause.IsEnabled = false; ((GDGameHUD)HUD).BtnSpeed.IsEnabled = false; GameSpeedMode = GameSpeedModes.NORMAL; HUD.AddModal(new HUDScorePanel(lvl, profile, newDifficulties, Difficulty, playerHasWon, addPoints, time), false); if (playerHasWon && (MainGame.Flavor == GDFlavor.IAB || MainGame.Flavor == GDFlavor.IAB_NOMP)) { var diff = UnlockManager.GetFullUnlockState().Except(_unlocksBefore); foreach (var d in diff) { if (d == Levels.WORLD_ID_ONLINE) { AchievementPopup.Show(L10N.T(L10NImpl.STR_ACH_UNLOCK_ONLINE)); } if (d == Levels.WORLD_ID_MULTIPLAYER) { AchievementPopup.Show(L10N.T(L10NImpl.STR_ACH_UNLOCK_MULTIPLAYER)); } if (d == Levels.WORLD_001.ID) { AchievementPopup.Show(L10N.TF(L10NImpl.STR_ACH_UNLOCK_WORLD, 1)); } if (d == Levels.WORLD_002.ID) { AchievementPopup.Show(L10N.TF(L10NImpl.STR_ACH_UNLOCK_WORLD, 2)); } if (d == Levels.WORLD_003.ID) { AchievementPopup.Show(L10N.TF(L10NImpl.STR_ACH_UNLOCK_WORLD, 3)); } if (d == Levels.WORLD_004.ID) { AchievementPopup.Show(L10N.TF(L10NImpl.STR_ACH_UNLOCK_WORLD, 4)); } } } }
protected override void OnClick(GameEntityMouseArea area, SAMTime gameTime, InputState istate) { #if DEBUG if (DebugSettings.Get("UnlockNode")) { OnClick_OpenAndUnlocked(); return; } if (DebugSettings.Get("WorldPreview")) { MainGame.Inst.Profile.PurchasedWorlds.Clear(); ShowPreview(); return; } #endif _ustate = UnlockManager.IsUnlocked(Blueprint, true); //MainGame.Inst.GDBridge.IAB.SynchronizePurchases(GDConstants.IABList); switch (_ustate) { case WorldUnlockState.OpenAndUnlocked: OnClick_OpenAndUnlocked(); break; case WorldUnlockState.ReachableButMustBePreviewed: OnClick_ReachableButMustBeBought(); break; case WorldUnlockState.UnreachableButCanBePreviewed: OnClick_UnreachableButCanBeBought(); break; case WorldUnlockState.UnreachableAndFullyLocked: OnClick_UnreachableAndFullyLocked(); break; default: throw new ArgumentOutOfRangeException(); } }