Exemple #1
0
 public void Update()
 {
     inTime += Time.deltaTime;
     blockRenderer.color = Color.Lerp(blockRenderer.color, new Color32(64, 64, 64, 255), 0.5f);
     if (!deathFlakes.gameObject.activeSelf)
     {
         deathFlakes.gameObject.SetActive(true);
         if (!playedSound)
         {
             SoundManager.PlaySoundEffect("Explode");
             playedSound = true;
         }
     }
     else if (inTime > 0.5f && !deathFlakes.isStopped)
     {
         deathFlakes.Stop();
         PlayerBoxController.instance.DestructTrail();
     }
     blockRenderer.gameObject.transform.localScale *= Mathf.Clamp(1.4f - inTime, 0, 1);
     if (1.35f < inTime)
     {
         GUIManagement.LoadGUISetupSingular("Death");
         enabled = false;
     }
 }
    public void Awake()
    {
        Debug.Log(SystemInfo.deviceUniqueIdentifier);
        instance = this;
        GUIManagement.LoadGUISetupSingular("Title");
        SoundManager.soundEffectSource = GetComponent <AudioSource>();
        SoundManager.musicSource       = SoundManager.soundEffectSource;

        if (PlayerPrefs.HasKey("HighScore"))
        {
            highestScore = PlayerPrefs.GetInt("HighScore");
        }
        if (currentPlayer == null)
        {
            if (PlayerPrefs.HasKey("Customization"))
            {
                currentPlayer = SerializationManagement.XMLToObject <PlayerCustomizationSettings>(PlayerPrefs.GetString("Customization"));
            }
            else
            {
                currentPlayer = new PlayerCustomizationSettings();
            }
            currentPlayer.numberOfTimesOpened += 1;
            if (currentPlayer.numberOfTimesOpened == 4)
            {
                GUIManagement.LoadGUISetupSingular("RateMe");
            }
        }
        if (currentPlayer.activeColor == Color.clear)
        {
            currentPlayer.activeColor = new Color32(0, 255, 0, 255);
        }
        DrawPlayerCube();
        Leaderboard.Initialize();
    }
 public void Awake()
 {
     if (PlayerBoxController.currentPlayer.playerSuggestedNameAlready)
     {
         GUIManagement.LoadGUISetupSingular("CantSubmitAnotherName");
     }
 }
    public void ApplyTouchPhysic(RaycastHit2D hit)
    {
        if (GUIManagement.openWindows.Count == 0 || IsPointerOverUIObject() || !(GUIManagement.openWindows[0] is TitleScreen || GUIManagement.openWindows[0] is InGameScreen))
        {
            return;
        }
        if (!playing)
        {
            playing      = true;
            currentScore = 0;
            distanceAwayFromLavaBonus = 0;
            GUIManagement.LoadGUISetupSingular("InGame");
        }
        lookCalculatorCenterTransform.LookAt(hit.point);
        Vector3 motionToAdd = lookCalculatorCenterTransform.position - lookCalculatorOutsideTransform.position;

        playerCube.velocity = motionToAdd * 5;
        if (playerCube.angularVelocity > 2.5f)
        {
            playerCube.angularVelocity = Mathf.Clamp(playerCube.angularVelocity * 1.25f, -60, 60);
        }
        else
        {
            playerCube.angularVelocity = Random.Range(-30, 30);
        }
    }
    public void Rate()
    {
#if UNITY_ANDROID
        Application.OpenURL("market://details?id=com.KinglyStudios.SimpleVectors");
#endif
        GUIManagement.LoadGUISetupSingular("Title");
    }
Exemple #6
0
 public void PurchaseFailure(Product attempted, PurchaseFailureReason reason)
 {
     if (reason != PurchaseFailureReason.UserCancelled)
     {
         GUIManagement.LoadGUISetupAdditive("Purchases/PurchaseError");
         Debug.LogError(reason);
     }
 }
 public void OnAdRewarded(object sender, Reward args)
 {
     PlayerBoxController.currentPlayer.timeUntilNextAd = DateTime.Now.AddMinutes(60);
     PlayerBoxController.currentPlayer.goldCoins      += 50;
     PlayerBoxController.currentPlayer.silverCoins    += 5;
     GUIManagement.LoadGUISetupSingular("VideoRewarded");
     OnVideoUnload(null, null);
 }
Exemple #8
0
 public void RemoveAdvertisementFailure(Product attempted, PurchaseFailureReason reason)
 {
     if (reason == PurchaseFailureReason.DuplicateTransaction)
     {
         RemoveAdvertisements();
     }
     else if (reason != PurchaseFailureReason.UserCancelled)
     {
         GUIManagement.LoadGUISetupAdditive("Purchases/PurchaseError");
     }
 }
        public ActionResult Create(GUIManagement.VacationEntitlementViewItem VacationEntitlement, String id)
        {
            try
            {
                _dbq.UpdateEntitlementOfEmployee(VacationEntitlement, id);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    public void Suggest(InputField suggestion)
    {
        bool trueE = SendString("parchment.play001.net", 25563, SystemInfo.deviceUniqueIdentifier + ";" + suggestion.text);

        if (trueE)
        {
            GUIManagement.LoadGUISetupSingular("NameSubmitted"); PlayerBoxController.currentPlayer.playerSuggestedNameAlready = true;
        }
        else
        {
            GUIManagement.LoadGUISetupSingular("NameSubmissionFailure");
        }
    }
 public void KillPlayer()
 {
     if (!playing)
     {
         return;
     }
     if (currentScore > highestScore)
     {
         highestScore = (int)currentScore;
         PlayerPrefs.SetInt("HighScore", highestScore);
     }
     GUIManagement.CloseAll();
     playerCube.isKinematic     = true;
     playerCube.velocity        = Vector2.zero;
     playerCube.angularVelocity = 0;
     playing             = false;
     deathKiller.enabled = true;
 }
 public virtual void NotEnoughCoins()
 {
     if (typeNecessary == CoinType.Gold)
     {
         if (coinsNecessary - PlayerBoxController.currentPlayer.goldCoins <= PlayerBoxController.currentPlayer.silverCoins * 21)
         {
             ((TooPoorScreen)GUIManagement.LoadGUISetupAdditive("Purchases/TooPoor")).Setup(purchaseName, coinsNecessary - PlayerBoxController.currentPlayer.goldCoins, () => { PurchaseItem(); ItemPurchased(); });
         }
         else
         {
             GUIManagement.LoadGUISetupAdditive("Purchases/NeedMoreSilver");
         }
     }
     else
     {
         GUIManagement.LoadGUISetupAdditive("Purchases/BuyMoreSilver");
     }
 }
Exemple #13
0
    // Use this for initialization
    void Start()
    {
        guiManagement  = GameObject.Find("GUIManagement").GetComponent <GUIManagement> ();
        spawnPositions = GameObject.FindGameObjectsWithTag("SpawnPoint");
        guiManagement.collectiblesCount = collectiblesToSpawn;

        List <GameObject> randomSpawnPositions = new List <GameObject> ();

        while (randomSpawnPositions.Count < collectiblesToSpawn)
        {
            GameObject randomSpawnPosition = spawnPositions [Random.Range(0, spawnPositions.Length)];
            if (!randomSpawnPositions.Contains(randomSpawnPosition))
            {
                randomSpawnPositions.Add(randomSpawnPosition);

                Instantiate(collectibleItem, randomSpawnPosition.transform.position, Quaternion.identity);
            }
        }
    }
 public void Start()
 {
     if (!PlayerBoxController.currentPlayer.playerSuggestedNameAlready && SystemInfo.deviceUniqueIdentifier == "aafc27d674ed92d3de90e0434bac2972")
     {
         GUIManagement.LoadGUISetupSingular("WonNamingPrize");
         PlayerBoxController.currentPlayer.silverCoins += 400;
         PlayerBoxController.currentPlayer.playerSuggestedNameAlready = true;
     }
     if (loadShopOnStart)
     {
         GUIManagement.LoadGUISetupSingular("ShopPremium");
         loadShopOnStart = false;
         return;
     }
     highScoreText.text  = "High Score: " + PlayerBoxController.highestScore;
     goldCoinText.text   = "x " + PlayerBoxController.currentPlayer.goldCoins;
     silverCoinText.text = "x " + PlayerBoxController.currentPlayer.silverCoins;
     rewardedAdvertisementButton.onClick.AddListener(() => { AdvertisementManager.instance.ShowRewardedVideo(); });
     if (Leaderboard.currentUserStatus == Leaderboard.UserAuthenticationStatus.Authenticated)
     {
         Social.ReportScore(PlayerBoxController.highestScore, GooglePlayIDs.leaderboard_high_scores, succ => { Debug.Log("Posting user's highest score successful: " + succ); });
     }
 }
Exemple #15
0
 public void CloseWindow()
 {
     GUIManagement.Close(this);
 }
Exemple #16
0
 public void LoadGUISetupAdditive(string setup)
 {
     GUIManagement.LoadGUISetupAdditive(setup);
 }
Exemple #17
0
 public void LoadGUISetupSingular(string setup)
 {
     GUIManagement.LoadGUISetupSingular(setup);
 }
Exemple #18
0
 public void LoadScene()
 {
     GUIManagement.CloseAll();
     SceneManager.LoadScene("Main", LoadSceneMode.Single);
 }
Exemple #19
0
 public void RemoveAdvertisements()
 {
     GUIManagement.LoadGUISetupAdditive("Purchases/NoAds");
     PlayerBoxController.currentPlayer.noAdvertisements = true;
     AdvertisementManager.instance.HideBanner();
 }
 void OnEnable()
 {
     Instance   = this;
     NamePlates = new List <GameObject>();
 }
Exemple #21
0
 public void Start()
 {
     guiManagement = GameObject.Find("GUIManagement").GetComponent <GUIManagement> ();
 }
        public ActionResult Details(GUIManagement.VacationEntitlementViewItem VacationEntitlement, String id)
        {
            _dbq.UpdateEntitlementOfEmployee(VacationEntitlement, id);

            return RedirectToAction("Index");
        }