コード例 #1
0
    public void OnCompleteScaleSwitchMap()
    {
        if (SCR_Gameplay.instance.pendingDiscover)
        {
            SCR_Gameplay.instance.SwitchMap(SCR_Gameplay.GetMapFromZombieIndex(SCR_Gameplay.instance.pendingIndex));
        }

        Destroy(gameObject);
    }
コード例 #2
0
    public void RefreshUpgradeInfo()
    {
        for (int i = 0; i < zombieUpgradePrices.Length; i++)
        {
            int productionRate = SCR_Config.GetProductionRate(i);

            zombieLevels[i].text          = "LEVEL " + (SCR_Profile.upgradeZombies[i] + 1).ToString();
            zombieProductionRates[i].text = SCR_Gameplay.FormatNumber(productionRate) + " brains/s";
            zombieUpgradePrices[i].text   = SCR_Gameplay.FormatNumber(SCR_Config.GetUpgradePrice(i));
        }

        SCR_Gameplay.instance.UpdateTotalProductionRate();
    }
コード例 #3
0
    public void Start()
    {
        for (int i = 0; i < zombiePrices.Length; i++)
        {
            string productionRate = SCR_Gameplay.FormatNumber(SCR_Config.GetProductionRate(i)) + " brains/s";

            zombieNames[i].text           = SCR_Config.ZOMBIE_INFO[i].name.ToUpper();
            zombieProductionRates[i].text = productionRate;
            zombiePrices[i].text          = SCR_Gameplay.FormatNumber(SCR_Config.ZOMBIE_INFO[i].price);
        }

        RefreshUnlocked();
        UpdateBrain();
    }
コード例 #4
0
    public void UpdateZombie()
    {
        for (int i = 0; i < zombies.Length; i++)
        {
            zombies[i].SetActive(false);
        }

        zombies[currentZombie].SetActive(true);

        string productionRate = "Brains per second: " + SCR_Gameplay.FormatNumber(SCR_Config.GetProductionRate(currentZombie));

        txtName.text           = SCR_Config.ZOMBIE_INFO[currentZombie].name.ToUpper();
        txtProductionRate.text = productionRate.ToUpper();
        txtDescription.text    = SCR_Config.ZOMBIE_INFO[currentZombie].description.ToUpper();
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        Application.targetFrameRate = 60;

        screenHeight = 19.2f;
        screenWidth  = screenHeight * Screen.width / Screen.height;

        spawnTime = 0;
        score     = 0;
        best      = PlayerPrefs.GetInt("best", 0);

        txtScore.SetActive(false);
        txtWave.SetActive(false);

        transform.position           = new Vector3(transform.position.x, CAMERA_POSITION_READY, transform.position.z);
        Camera.main.orthographicSize = CAMERA_SIZE_READY;

        cvsMainMenu.SetActive(true);
        cvsGameplay.SetActive(false);
        cvsGameOver.SetActive(false);

        source.clip = sndMainMenu;
        source.Play();

        spawningEnemies = false;
        spawnCount      = 0;
        currentWave     = 0;

        state = GameState.READY;

        instance = this;

                #if UNITY_ANDROID
        string appId = "ca-app-pub-0081066185741622~1212788759";
                #elif UNITY_IPHONE
        string appId = "ca-app-pub-0081066185741622~2263405726";
                #else
        string appId = "unexpected_platform";
                #endif

        // Initialize the Google Mobile Ads SDK.
        MobileAds.Initialize(appId);

        RequestInterstitial();
    }
コード例 #6
0
    private void OnCompleteFadeOut()
    {
        if (SCR_Gameplay.instance.cvsGameplay.activeSelf)
        {
            GameObject plusBrain = Instantiate(PFB_PLUS_BRAIN);

            RectTransform rectTransform = plusBrain.GetComponent <RectTransform>();
            RectTransform canvasRT      = SCR_Gameplay.instance.cvsGameplay.GetComponent <RectTransform>();
            rectTransform.SetParent(canvasRT, false);
            rectTransform.SetAsFirstSibling();

            float x = transform.position.x / SCR_Gameplay.SCREEN_WIDTH * canvasRT.rect.width;
            float y = transform.position.y / SCR_Gameplay.SCREEN_HEIGHT * canvasRT.rect.height + PLUS_BRAIN_OFFSET_Y;
            rectTransform.anchoredPosition = new Vector2(x, y);

            plusBrain.GetComponent <Text>().text = "+" + SCR_Gameplay.FormatNumber(brainValue);
        }

        Destroy(gameObject);
    }
コード例 #7
0
    // Use this for initialization
    void Start()
    {
        startX = transform.position.x;
        startY = transform.position.y;
        startZ = transform.position.z;

        radius = Mathf.Abs(startX);

        targetY         = startY;
        currentRotation = transform.localEulerAngles.y;
        targetRotation  = currentRotation;

        scrGameplay = GetComponent <SCR_Gameplay>();
        scrSphere   = sphere.GetComponent <SCR_Sphere>();

        lastHit = null;

        //ZoomIn();
        Camera.main.orthographicSize = 1;
        transform.position           = new Vector3(transform.position.x, startY - 1.25f, transform.position.z);
    }
コード例 #8
0
    // Init
    private void Awake()
    {
        // Don't do anything if menu state is not the first state
        // Load the menu instead
        if (SCR_Menu.menuLoaded == false)
        {
            SceneManager.LoadScene("GSMenu/SCN_Menu");
            return;
        }

        // Assign instance
        instance = this;

        // Calculate screen resolution
        SCREEN_RATIO = Screen.height * 1.0f / Screen.width;
        SCREEN_W     = 1080;
        SCREEN_H     = 1080 * SCREEN_RATIO;
        SCREEN_SCALE = SCREEN_W / 10.8f;
        TOUCH_SCALE  = SCREEN_W / Screen.width;

        // Set camera
        Camera.main.orthographicSize   = SCREEN_H * 0.5f;
        Camera.main.transform.position = new Vector3(SCREEN_W * 0.5f, SCREEN_H * 0.5f, Camera.main.transform.position.z);
    }
コード例 #9
0
    // Use this for initialization
    void Start()
    {
        rb        = GetComponent <Rigidbody>();
        speedX    = MOVE_SPEED;
        speedZ    = 0;
        turnAngle = 0;

        for (int i = 0; i < NUMBER_ANIMALS; i++)
        {
            transform.GetChild(i).gameObject.SetActive(false);
        }

        model = transform.GetChild(currentAnimal);
        model.gameObject.SetActive(true);

        startRotationX = transform.localEulerAngles.x;
        startRotationZ = transform.localEulerAngles.z;

        scrGameplay   = Camera.main.GetComponent <SCR_Gameplay>();
        lastCollision = null;
        lastCorner    = null;

        allowJump = true;
    }
コード例 #10
0
 public void Awake()
 {
     instance = this;
 }