コード例 #1
0
 public void OnFrankKilled()
 {
     frankCount -= 1;
     money      += baseBounty;
     baseBounty += bountyIncrease;
     MoneyText.SetNumber((int)money);
 }
コード例 #2
0
 private void Update()
 {
     MouseDelta   = Input.mousePosition - prevMousePos;
     prevMousePos = Input.mousePosition;
     if (IsPaused && pauseScreen.activeSelf && Input.GetKeyDown(KeyCode.Escape))
     {
         UnpauseGame();
         return;
     }
     if (!IsIdle)
     {
         return;
     }
     if (Input.GetKeyDown(KeyCode.Escape) && (!SelectableObject.selected || SelectableObject.selected == main))
     {
         PauseGame();
         return;
     }
     if (frankCount == 0)
     {
         Win();
         return;
     }
     time  += Time.deltaTime;
     money += moneyGain * Time.deltaTime;
     MoneyText.SetNumber((int)money);
     GameCamera.HandleUpdate();
 }
コード例 #3
0
 // Start is called before the first frame update
 void Awake()
 {
     InputText = FindObjectOfType <CommandLineField>();
     Console   = FindObjectOfType <ConsoleText>();
     Missions  = FindObjectOfType <MissionText>();
     Money     = FindObjectOfType <MoneyText>();
     Computer  = new InitialComputer();
 }
コード例 #4
0
 public void AddFloatingText(int money)
 {
     if (money != 0)
     {
         moneyToGive = "+" + tower.stats.moneyPerSecond;
         MoneyText objInst = Instantiate(floatingText);
         objInst.transform.SetParent(gameObject.transform.parent);
         objInst.textMoney.text = moneyToGive;
     }
 }
コード例 #5
0
 void Awake()
 {
     Util.em           = this;
     wm                = GetComponent <WorldManager>();
     moneyText         = GameObject.Find("MoneyText").GetComponent <MoneyText>();
     rateText          = GameObject.Find("RateText").GetComponent <RateText>();
     sandwichValueText = GameObject.Find("SandwichValueText").GetComponent <SandwichValueText>();
     list              = GameObject.Find("Producer");
     multiplierGlow    = GameObject.Find("MultiplierGlow").GetComponent <MultiplierGlow>();
 }
コード例 #6
0
 public bool SpendMoney(int moneySpent)
 {
     if (money >= moneySpent)
     {
         SFXManager.Instance.PlaySFX("Money");
         money -= moneySpent;
         MoneyText.SetNumber((int)money);
         return(true);
     }
     return(false);
 }
コード例 #7
0
    void SetupUI()
    {
        gameOverUI = GameObject.Find("GameOverUI").GetComponent <UIPanel>();
        postGameUI = GameObject.Find("PostGameUI").GetComponent <UIPanel>();
        preGameUI  = GameObject.Find("PreGameUI").GetComponent <UIPanel>();
        gameUI     = GameObject.Find("GameUI").GetComponent <UIPanel>();
        shopUI     = GameObject.Find("ShopUI").GetComponent <UIPanel>();
        mapUI      = GameObject.Find("MapUI").GetComponent <UIPanel>();

        failMoneyText        = GameObject.Find("FailMoneyText").GetComponent <Text>();
        successMoneyText     = GameObject.Find("SuccessMoneyText").GetComponent <Text>();
        preGameMoneyText     = GameObject.Find("PreGameMoneyText").GetComponent <Text>();
        postGameMoneyText    = GameObject.Find("PostGameMoneyText").GetComponent <Text>();
        shopMoneyText        = GameObject.Find("ShopMoneyText").GetComponent <Text>();
        preGameLocationText  = GameObject.Find("PreGameLocationText").GetComponent <Text>();
        postGameLocationText = GameObject.Find("PostGameLocationText").GetComponent <Text>();
        postGameContinueText = GameObject.Find("PostGameContinueText").GetComponent <Text>();

        moneyText = FindObjectOfType <MoneyText>();
    }
コード例 #8
0
 // Use this for initialization
 void Awake()
 {
     moneyGauge = MoneyGaugeSlider.GetComponent <MoneyGauge>();
     moneyText  = MoneyGaugeText.GetComponent <MoneyText>();
     if (PlayerPrefs.HasKey("Money")) // セーブデータ存在
     {
         Money    = PlayerPrefs.GetFloat("Money");
         MaxMoney = PlayerPrefs.GetFloat("MaxMoney");
         //PlayerPrefs.SetInt("MaxMoney", MaxMoney);
     }
     else           // セーブデータ無
     {
         Money    = 0;
         MaxMoney = 5000;
         PlayerPrefs.SetFloat("Money", Money);
         PlayerPrefs.SetFloat("MaxMoney", MaxMoney);
     }
     moneyGauge.UpDateGauge(Money, 1);
     moneyText.UpDateText((int)Money, 1);
 }
コード例 #9
0
    void Awake()
    {
        if (Instance)
        {
            return;
        }
        Instance   = this;
        GameCamera = GetComponentInChildren <GameCamera>();
        MoneyText  = GetComponentInChildren <MoneyText>();
        MoneyText.SetNumber((int)money, true);
        notificationManager = GetComponentInChildren <NotificationManager>();
        weaponManager       = GetComponentInChildren <WeaponManager>();

        // Intro
        GameState = GameState.Cutscene;
        introScreen.gameObject.SetActive(true);
        pauseScreen.SetActive(false);

        // Spawn franks
        SpawnFranks();

        prevMousePos = Input.mousePosition;
    }
コード例 #10
0
ファイル: ShopHandler.cs プロジェクト: mgupta8143/cube-tube
    void turnOnValuablesShop()
    {
        ColorsButton.GetComponent <Image>().color     = Color.white;
        ShapesButton.GetComponent <Image>().color     = Color.white;
        PathColorsButton.GetComponent <Image>().color = Color.white;
        ThemesButton.GetComponent <Image>().color     = Color.white;
        MusicButton.GetComponent <Image>().color      = Color.white;
        MoneyButton.GetComponent <Image>().color      = Color.gray;

        PlayerColorText.GetComponent <Text>().color = Color.black;
        PlayerShapeText.GetComponent <Text>().color = Color.black;
        PathColorText.GetComponent <Text>().color   = Color.black;
        ThemeText.GetComponent <Text>().color       = Color.black;
        MusicText.GetComponent <Text>().color       = Color.black;
        MoneyText.GetComponent <Text>().color       = Color.white;

        PlayerColorShop.SetActive(false);
        PlayerShapeShop.SetActive(false);
        PathColorShop.SetActive(false);
        ThemeShop.SetActive(false);
        TrailShop.SetActive(false);
        ValuablesShop.SetActive(true);
    }
コード例 #11
0
        private GameObject CreateKillCounter()
        {
            HUD     Hud    = FindObjectOfType <HUD>();
            Vector2 ogSize = Hud.lunarCoinContainer.transform.parent.GetComponent <RectTransform>().sizeDelta;

            //Increase size to bypass the squishing
            Hud.lunarCoinContainer.transform.parent.GetComponent <RectTransform>().sizeDelta = new Vector2(ogSize.x, ogSize.y + 20);

            //Duplicate the Lunarcoin Display
            GameObject KillCounterContainer = Instantiate(Hud.lunarCoinContainer, Hud.lunarCoinContainer.transform.parent);

            KillCounterContainer.name = "KillCounterContainer";
            MoneyText KillCounterText = KillCounterContainer.GetComponent <MoneyText>();

            KillCounterText.targetValue = kills;
            FlashPanel KillCounterFlash = KillCounterContainer.GetComponent <FlashPanel>();

            KillCounterFlash.flashRectTransform.GetComponent <Image>().color = Color.cyan;

            BGTex = Instantiate <Sprite>(Hud.lunarCoinContainer.transform.parent.GetComponent <Image>().sprite);
            DontDestroyOnLoad(BGTex);

            return(KillCounterText.gameObject);
        }
コード例 #12
0
ファイル: ShopHandler.cs プロジェクト: mgupta8143/cube-tube
    void turnOnPathColorShop()
    {
        ColorsButton.GetComponent <Image>().color     = Color.white;
        ShapesButton.GetComponent <Image>().color     = Color.white;
        PathColorsButton.GetComponent <Image>().color = Color.gray;
        ThemesButton.GetComponent <Image>().color     = Color.white;
        MusicButton.GetComponent <Image>().color      = Color.white;
        MoneyButton.GetComponent <Image>().color      = Color.green;

        PlayerColorText.GetComponent <Text>().color = Color.black;
        PlayerShapeText.GetComponent <Text>().color = Color.black;
        PathColorText.GetComponent <Text>().color   = Color.white;
        ThemeText.GetComponent <Text>().color       = Color.black;
        MusicText.GetComponent <Text>().color       = Color.black;
        MoneyText.GetComponent <Text>().color       = Color.white;


        PlayerColorShop.SetActive(false);
        PlayerShapeShop.SetActive(false);
        PathColorShop.SetActive(true);
        ThemeShop.SetActive(false);
        TrailShop.SetActive(false);
        ValuablesShop.SetActive(false);



        //for default
        if (PlayerPrefs.GetInt("PathColorOnce") == 0)
        {
            buyPathColorItem(0, "RedPath");
            PlayerPrefs.SetInt("PathColorOnce", 1);
        }

        //if bought then keep transparent colors default if bought
        if (PlayerPrefs.GetInt("RedPath", 0) == 1)
        {
            GameObject.Find("RedPathCost").GetComponent <Text>().text = "Red";
        }
        if (PlayerPrefs.GetInt("BluePath", 0) == 1)
        {
            GameObject.Find("BluePathCost").GetComponent <Text>().text = "Blue";
        }
        if (PlayerPrefs.GetInt("YellowPath", 0) == 1)
        {
            GameObject.Find("YellowPathCost").GetComponent <Text>().text = "Yellow";
        }
        if (PlayerPrefs.GetInt("OrangePath", 0) == 1)
        {
            GameObject.Find("OrangePathCost").GetComponent <Text>().text = "Orange";
        }
        if (PlayerPrefs.GetInt("GreenPath", 0) == 1)
        {
            GameObject.Find("GreenPathCost").GetComponent <Text>().text = "Green";
        }
        if (PlayerPrefs.GetInt("PurplePath", 0) == 1)
        {
            GameObject.Find("PurplePathCost").GetComponent <Text>().text = "Purple";
        }
        if (PlayerPrefs.GetInt("PinkPath", 0) == 1)
        {
            GameObject.Find("PinkPathCost").GetComponent <Text>().text = "Pink";
        }
        if (PlayerPrefs.GetInt("WhitePath", 0) == 1)
        {
            GameObject.Find("WhitePathCost").GetComponent <Text>().text = "White";
        }

        GameObject.Find(PlayerPrefs.GetString("WhichPathColorSelected") + "Cost").GetComponent <Text>().text = "Selected"; //selected on start
    }
コード例 #13
0
ファイル: ShopHandler.cs プロジェクト: mgupta8143/cube-tube
    void turnOnPlayerShapeShop()
    {
        ColorsButton.GetComponent <Image>().color     = Color.white;
        ShapesButton.GetComponent <Image>().color     = Color.gray;
        PathColorsButton.GetComponent <Image>().color = Color.white;
        ThemesButton.GetComponent <Image>().color     = Color.white;
        MusicButton.GetComponent <Image>().color      = Color.white;
        MoneyButton.GetComponent <Image>().color      = Color.green;

        PlayerColorText.GetComponent <Text>().color = Color.black;
        PlayerShapeText.GetComponent <Text>().color = Color.white;
        PathColorText.GetComponent <Text>().color   = Color.black;
        ThemeText.GetComponent <Text>().color       = Color.black;
        MusicText.GetComponent <Text>().color       = Color.black;
        MoneyText.GetComponent <Text>().color       = Color.white;


        PlayerColorShop.SetActive(false);
        PlayerShapeShop.SetActive(true);
        PathColorShop.SetActive(false);
        ThemeShop.SetActive(false);
        TrailShop.SetActive(false);
        ValuablesShop.SetActive(false);



        if (PlayerPrefs.GetInt("PlayerShapeOnce") == 0)
        {
            buyPlayerShapeItem(0, "Cube");
            PlayerPrefs.SetInt("PlayerShapeOnce", 1);
        }

        if (PlayerPrefs.GetInt("CubeShape", 0) == 1)
        {
            GameObject.Find("CubeCost").GetComponent <Text>().text = "Cube";
        }
        if (PlayerPrefs.GetInt("SphereShape", 0) == 1)
        {
            GameObject.Find("SphereCost").GetComponent <Text>().text = "Sphere";
        }
        if (PlayerPrefs.GetInt("BirdShape", 0) == 1)
        {
            GameObject.Find("BirdCost").GetComponent <Text>().text = "Bird";
        }
        if (PlayerPrefs.GetInt("TurtleShape", 0) == 1)
        {
            GameObject.Find("TurtleCost").GetComponent <Text>().text = "Turtle";
        }
        if (PlayerPrefs.GetInt("PlaneShape", 0) == 1)
        {
            GameObject.Find("PlaneCost").GetComponent <Text>().text = "Fish";
        }
        if (PlayerPrefs.GetInt("XShape", 0) == 1)
        {
            GameObject.Find("XCost").GetComponent <Text>().text = "Butterfly";
        }
        if (PlayerPrefs.GetInt("HeadShape", 0) == 1)
        {
            GameObject.Find("HeadCost").GetComponent <Text>().text = "Squirrel";
        }
        if (PlayerPrefs.GetInt("BatmanShape", 0) == 1)
        {
            GameObject.Find("BatmanCost").GetComponent <Text>().text = "Cylinder";
        }

        GameObject.Find(PlayerPrefs.GetString("WhichPlayerShapeSelected") + "Cost").GetComponent <Text>().text = "Selected"; //selected on start
    }
コード例 #14
0
ファイル: ShopHandler.cs プロジェクト: mgupta8143/cube-tube
    void turnOnThemeShop()
    {
        ColorsButton.GetComponent <Image>().color     = Color.white;
        ShapesButton.GetComponent <Image>().color     = Color.white;
        PathColorsButton.GetComponent <Image>().color = Color.white;
        ThemesButton.GetComponent <Image>().color     = Color.gray;
        MusicButton.GetComponent <Image>().color      = Color.white;
        MoneyButton.GetComponent <Image>().color      = Color.green;

        PlayerColorText.GetComponent <Text>().color = Color.black;
        PlayerShapeText.GetComponent <Text>().color = Color.black;
        PathColorText.GetComponent <Text>().color   = Color.black;
        ThemeText.GetComponent <Text>().color       = Color.white;
        MusicText.GetComponent <Text>().color       = Color.black;
        MoneyText.GetComponent <Text>().color       = Color.white;


        PlayerColorShop.SetActive(false);
        PlayerShapeShop.SetActive(false);
        PathColorShop.SetActive(false);
        ThemeShop.SetActive(true);
        TrailShop.SetActive(false);
        ValuablesShop.SetActive(false);



        //for default
        if (PlayerPrefs.GetInt("ThemeOnce") == 0)
        {
            buyThemeItem(0, "WhiteBlackColor");
            PlayerPrefs.SetInt("ThemeOnce", 1);
        }

        //if bought then keep transparent colors default if bought
        if (PlayerPrefs.GetInt("WhiteBlackColor", 0) == 1)
        {
            GameObject.Find("WhiteBlackColorCost").GetComponent <Text>().text = "Normal";
        }
        if (PlayerPrefs.GetInt("BlackWhiteColor", 0) == 1)
        {
            GameObject.Find("BlackWhiteColorCost").GetComponent <Text>().text = "Inverted";
        }
        if (PlayerPrefs.GetInt("BlueYellowColor", 0) == 1)
        {
            GameObject.Find("BlueYellowColorCost").GetComponent <Text>().text = "Yankee";
        }
        if (PlayerPrefs.GetInt("GreenRedColor", 0) == 1)
        {
            GameObject.Find("GreenRedColorCost").GetComponent <Text>().text = "Holidays";
        }
        if (PlayerPrefs.GetInt("PinkPurpleColor", 0) == 1)
        {
            GameObject.Find("PinkPurpleColorCost").GetComponent <Text>().text = "Pink";
        }
        if (PlayerPrefs.GetInt("GreenGreenColor", 0) == 1)
        {
            GameObject.Find("GreenGreenColorCost").GetComponent <Text>().text = "Forest";
        }
        if (PlayerPrefs.GetInt("YellowYellowColor", 0) == 1)
        {
            GameObject.Find("YellowYellowColorCost").GetComponent <Text>().text = "Sandy";
        }
        if (PlayerPrefs.GetInt("OrangeRedColor", 0) == 1)
        {
            GameObject.Find("OrangeRedColorCost").GetComponent <Text>().text = "Sunny";
        }

        GameObject.Find(PlayerPrefs.GetString("WhichThemeSelected") + "Cost").GetComponent <Text>().text = "Selected"; //selected on start
    }