void Start() { // Cache the user manager this.userManager = ModelLocator.GetModelInstance <UserManager>() as UserManager; this.cards = this.userManager.GetUserData().GetUserCards(); this.ConfirmButton.interactable = false; }
private void Start() { this.ShowButtons(true); this.ShowSignupInputs(false); this.userManager = ModelLocator.GetModelInstance <UserManager>() as UserManager; this.battleManager = ModelLocator.GetModelInstance <BattleManager>() as BattleManager; }
void Start() { // Cache the collider this.boxCollider = this.GetComponent <BoxCollider>(); // Cache the battle manager this.battleManager = ModelLocator.GetModelInstance <BattleManager>() as BattleManager; }
void Start() { // Cache the user and battle managers this.userManager = ModelLocator.GetModelInstance <UserManager>() as UserManager; this.battleManager = ModelLocator.GetModelInstance <BattleManager>() as BattleManager; // Show stage start countdown overlay this.ShowCountdownOverlay(); // Hide stage results overlay this.ResultOverlay.SetActive(false); }
void Start() { // Cache the stage manager this.battleManager = ModelLocator.GetModelInstance <BattleManager>() as BattleManager; // Cache the main camera transform this.mainCameraTransform = this.mainCamera.transform; // Rotation for main camera forward vector Quaternion rotation = Quaternion.Euler(-10f, 0, 0); // Multiply main camera forward vector by main camera speed Vector3 velocity = this.mainCameraSpeed * Vector3.forward; // Cache the main camera forward vector this.mainCameraForwardVector = rotation * velocity; }
private void Start() { // Cache the user and stage managers this.userManager = ModelLocator.GetModelInstance <UserManager>() as UserManager; this.battleManager = ModelLocator.GetModelInstance <BattleManager>() as BattleManager; // Cache current level and stage this.currentLevel = this.userManager.GetUserData().GetCurrentLevel(); this.currentStage = this.userManager.GetUserData().GetCurrentStage(); // Layout UI this.SetTitle(); this.ShowCardSelectOverlay(false); this.LayoutMenuWithStageButtons(); }
// Called by EndBoundary on stage completion public void EndStage() { // The stage ends when the EndBoundary collides with the TouchBoundary this.IsStageOver = true; // Cache the user manager UserManager userManager = ModelLocator.GetModelInstance <UserManager>() as UserManager; UserData userData = userManager.GetUserData(); // Cache the elementalPower of the selected card of the user ElementalPower userElementalPower = userData.SelectedCard.elementalPower; // Cache the elementalPower of the stage ElementalPower stageElementalPower = this.StageData.elementalPower; // Cache the stageItemDrops of the stage List <StageItemDrop> stageItemDrops = this.StageData.stageItemDrops; // Calculate stage results using user and stage properties this.StageResult = new StageResult( this.RawScore, userElementalPower, stageElementalPower, stageItemDrops); // If score meets the minimum of the stage score tier, clear the stage this.MetaData.isComplete = this.StageResult.FinalScore >= this.StageData.scoreTier[0]; // Set high score when the score is greater than the current high score this.MetaData.highScore = Mathf.Max( this.StageResult.FinalScore, this.MetaData.highScore); // Decrement daily attempts for this stage this.MetaData.DecrementDailyAttempt(); // Save updated user data Persistence.SaveUserData(userData); }
void Awake() { // Stage data has been loaded and cached in BattleManager this.battleManager = ModelLocator.GetModelInstance <BattleManager>() as BattleManager; this.BuildStanza(this.battleManager.StageData); }
void Start() { // Cache the stage manager this.battleManager = ModelLocator.GetModelInstance <BattleManager>() as BattleManager; }