예제 #1
0
    public void GenerateTemperature()
    {
        Transform      weather = GameObject.Find("Weather").transform;
        DressUpManager manager = (DressUpManager)TaskManager.Instance;

        Vector3    temperaturePostion  = weather.TransformPoint(0.4f, 0f, 0f);
        Vector3    relativePos         = temperaturePostion - Camera.main.transform.position;
        Quaternion temperatureRotation = Quaternion.LookRotation(relativePos);

        temperatureRotation.x = 0f;
        temperatureRotation.z = 0f;

        Transform temperature = Instantiate(manager.WeatherPrefabs.transform.GetChild(0), temperaturePostion, temperatureRotation, weather.GetChild(0).GetChild(1));

        int temperatureValue = new System.Random().Next(MinRange, MaxRange);

        temperature.GetComponent <TextMesh>().text = temperatureValue + "°C";

        /*int unit = temperature % 10;
         * int dec = (temperature - unit) / 10;
         *
         * if (dec != 0)
         * {
         *  Instantiate(manager.WeatherPrefabs.transform.GetChild(0).GetChild(dec), temperaturePostion, temperatureRotation, weather.GetChild(0).GetChild(1));
         * }
         * Instantiate(manager.WeatherPrefabs.transform.GetChild(0).GetChild(unit), temperaturePostion + new Vector3(0.1f, 0f, 0f), temperatureRotation, weather.GetChild(0).GetChild(1));
         * Instantiate(manager.WeatherPrefabs.transform.GetChild(0).GetChild(manager.WeatherPrefabs.transform.GetChild(0).childCount - 2), temperaturePostion + new Vector3(0.2f, 0f, 0f), temperatureRotation, weather.GetChild(0).GetChild(1));
         * Instantiate(manager.WeatherPrefabs.transform.GetChild(0).GetChild(manager.WeatherPrefabs.transform.GetChild(0).childCount - 1), temperaturePostion + new Vector3(0.3f, 0f, 0f), temperatureRotation, weather.GetChild(0).GetChild(1));*/
    }
예제 #2
0
    void Awake()
    {
        screen  = gameObject.GetComponent <ScreenManager>();
        dressUp = gameObject.GetComponent <DressUpManager>();
        player  = gameObject.GetComponent <PlayerManager>();
        sCart   = gameObject.GetComponent <ShoppingCart>();

        ScrollView  = scrollContainer.transform.GetChild(0).gameObject;
        Tabs        = scrollContainer.transform.GetChild(1);
        Inventory   = ScrollView.transform.GetChild(1).gameObject;
        GridBG      = ScrollView.transform.GetChild(2).gameObject;
        sCart.money = player.Seeds;

        scrollContainer.SetActive(true);
        sCart.shoppingCart.SetActive(false);
        player.scrollContainer.SetActive(false);
    }
예제 #3
0
    void Awake()
    {
        screen  = gameObject.GetComponent <ScreenManager>();
        store   = gameObject.GetComponent <StoreManager>();
        dressUp = gameObject.GetComponent <DressUpManager>();
        sCart   = gameObject.GetComponent <ShoppingCart>();

        ScrollView = scrollContainer.transform.GetChild(0).gameObject;
        Inventory  = ScrollView.transform.GetChild(1).gameObject;
        GridBG     = ScrollView.transform.GetChild(2).gameObject;
        Tabs       = scrollContainer.transform.GetChild(1);

        scrollContainer.SetActive(false);
        sellButton.SetActive(false);

        Seeds      = 2000;
        playerList = Serializer.DeserializeJSON(jsonFileName);
    }
예제 #4
0
        public void ProcessFullListofCommands(Temperature temperature, string[] command, string expectedOutput)
        {
            var actual = DressUpManager.ProcessCommands(temperature, command);

            Assert.AreEqual(actual.ToLower(), expectedOutput.ToLower());
        }