Beispiel #1
0
 void OnChangeState(System.Type stateType, bool isEntering)
 {
     if (isEntering)
     {
         if (stateType == typeof(EndDayState))
         {
             gameObject.SetActive(true);
             for (int i = 0; i < starDisplay.transform.childCount; i++)
             {
                 LARGEGARBAGE largeGarbageType = LargeGarbage.ByIndex(i);
                 Debug.Log(LargeGarbage.ByIndex(i).ToString());
                 if ((GlobalVariableManager.Instance.LARGE_GARBAGE_DISCOVERED & largeGarbageType) == largeGarbageType || (GlobalVariableManager.Instance.LARGE_GARBAGE_VIEWED & largeGarbageType) == largeGarbageType)
                 {
                     starDisplay.transform.GetChild(i).gameObject.GetComponent <Image>().sprite = filledStarSprite;
                 }
             }
             CamManager.Instance.mainCamEffects.ZoomInOut(.7f, .5f);
             SoundManager.instance.backupMusicSource.clip   = resultsMusic;
             SoundManager.instance.backupMusicSource.volume = GlobalVariableManager.Instance.MASTER_MUSIC_VOL;
             SoundManager.instance.backupMusicSource.Play();
             SoundManager.instance.musicSource.Stop();
             StartCoroutine("InteractDelay"); // wait for the truck to get a bit up the road.
         }
     }
 }
 public LargeTrashItem(LARGEGARBAGE p_type)
 {
     type     = p_type;
     isViewed = false;
     collectedDisplaySprite = null;
     collectedTitle         = "";
 }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (ControllerManager.Instance.GetKeyDown(INPUTACTION.INTERACT))
        {
            if (phase == 1)
            {
                SoundManager.instance.PlaySingle(continueSfx);
                StartCoroutine("NewStarFill");
                starDisplay.SetActive(true);
                for (int i = 0; i < starDisplay.transform.childCount; i++)
                {
                    LARGEGARBAGE largeGarbageType = LargeGarbage.ByIndex(i);
                    Debug.Log(LargeGarbage.ByIndex(i).ToString());
                    if (i != indexOfCurrentLargeTrash && (GlobalVariableManager.Instance.LARGE_GARBAGE_DISCOVERED & largeGarbageType) == largeGarbageType || (GlobalVariableManager.Instance.LARGE_GARBAGE_VIEWED & largeGarbageType) == largeGarbageType)
                    {
                        starDisplay.transform.GetChild(i).gameObject.GetComponent <SpriteRenderer>().color = Color.white;
                    }
                }
                StartCoroutine("NewStarFill");
                phase = 2;
            }
            else if (phase == 3)
            {
                SoundManager.instance.PlaySingle(continueSfx);

                Close();
            }
        }
    }
Beispiel #4
0
    void LargeTrashSpawn()
    {
        //all large trash is already placed in hub but deactivated. Maybe each large trash in hub(hub large trash
        //should  maybe be its own object..) has a number as its name. Com runs through all positions in
        //unlocked string and if = 'o' then searches scene for gameobject with a name = the index it's currently
        //at and enables it...

        for (int i = 0; i < sizeof(LARGEGARBAGE); ++i)
        {
            LARGEGARBAGE largeGarbageType = LargeGarbage.ByIndex(i);
            if ((GlobalVariableManager.Instance.LARGE_GARBAGE_DISCOVERED & largeGarbageType) == largeGarbageType)
            {
                GameObject.Find(i.ToString()).SetActive(true);
            }
        }
    }
    }    //end of Navigate()

    void SpawnStars()
    {
        myStars.SetActive(true);
        Debug.Log("Spawn Stars Activate");
        //float tempXStar = XofStar;
        for (int i = startLargeTrashIndex; i < myStars.transform.childCount; i++)
        {
            Debug.Log("StarSpawn");
            LARGEGARBAGE largeGarbageType = LargeGarbage.ByIndex(i);
            Debug.Log(LargeGarbage.ByIndex(i).ToString());
            if ((GlobalVariableManager.Instance.LARGE_GARBAGE_DISCOVERED & largeGarbageType) == largeGarbageType || (GlobalVariableManager.Instance.LARGE_GARBAGE_VIEWED & largeGarbageType) == largeGarbageType)
            {
                myStars.transform.GetChild(i).gameObject.GetComponent <SpriteRenderer>().color = Color.white;
            }
        }
    }    //End of SpawnStars()
    public override void Load(SimpleJSON.JSONObject json_data)
    {
        MASTER_MUSIC_VOL = json_data["MASTER_MUSIC_VOL"].AsFloat;
        MASTER_SFX_VOL   = json_data["MASTER_SFX_VOL"].AsFloat;

        DAY_NUMBER             = json_data["DAY_NUMBER"].AsInt;
        WORLD_ROOMS_DISCOVERED = (ROOM)json_data["WORLD_ROOMS_DISCOVERED"].AsInt;
        pinsDiscoveredValue    = json_data["pinsDiscoveredValue"].AsLong;
        pinsEquippedValue      = json_data["pinsEquippedValue"].AsLong;
        pinsViewedValue        = json_data["pinsViewedValue"].AsLong;


        EquippedAbilityPins[0] = (PIN)json_data["ABILITY_PIN_1"].AsLong;
        EquippedAbilityPins[1] = (PIN)json_data["ABILITY_PIN_2"].AsLong;

        STANDARD_GARBAGE_DISCOVERED   = (STANDARDGARBAGE)json_data["STANDARD_GARBAGE_DISCOVERED"].AsInt;
        STANDARD_GARBAGE_VIEWED       = (STANDARDGARBAGE)json_data["STANDARD_GARBAGE_VIEWED"].AsInt;
        COMPOST_GARBAGE_DISCOVERED    = (COMPOSTGARBAGE)json_data["COMPOST_GARBAGE_DISCOVERED"].AsInt;
        COMPOST_GARBAGE_VIEWED        = (COMPOSTGARBAGE)json_data["COMPOST_GARBAGE_VIEWED"].AsInt;
        RECYCLABLE_GARBAGE_DISCOVERED = (RECYCLABLEGARBAGE)json_data["RECYCLABLE_GARBAGE_DISCOVERED"].AsInt;
        RECYCLABLE_GARBAGE_VIEWED     = (RECYCLABLEGARBAGE)json_data["RECYCLABLE_GARBAGE_VIEWED"].AsInt;
        LARGE_GARBAGE_DISCOVERED      = (LARGEGARBAGE)json_data["LARGE_GARBAGE_DISCOVERED"].AsInt;
        LARGE_GARBAGE_VIEWED          = (LARGEGARBAGE)json_data["LARGE_GARBAGE_VIEWED"].AsInt;

        STAR_POINTS_STAT = new PlayerStat(PLAYERSTATTYPE.STAR_POINTS, json_data["STAR_POINTS"].AsInt);
        STAR_POINTS_STAT.SetCurrent(json_data["CURRENT_STAR_POINTS"].AsInt);

        HP_STAT = new PlayerStat(PLAYERSTATTYPE.HP, json_data["Max_HP"].AsInt);
        HP_STAT.ResetCurrent();

        BAG_SIZE_STAT = new PlayerStat(PLAYERSTATTYPE.BAG_SIZE, json_data["BAG_SIZE"].AsInt);
        HP_STAT.ResetCurrent();

        PP_STAT = new PlayerStat(PLAYERSTATTYPE.PP, json_data["PPVALUE"].AsInt);

        DEJAVUCOUNT             = json_data["DEJAVUCOUNT"].AsInt;
        CURSEVALUE              = json_data["CURSEVALUE"].AsInt;
        MOMONEYVALUE            = json_data["MOMONEYVALUE"].AsInt;
        PROGRESS_LV             = json_data["PROGRESS_LV"].AsInt;
        UPGRADES_UNLOCKED       = (UPGRADES)json_data["UPGRADES"].AsInt;
        TOTAL_DAYTIME_INSECONDS = json_data["TOTAL_DAYTIME_INSECONDS"].AsInt;
        TIME_UPGRADE_LEVEL      = json_data["TIME_UPGRADE_LEVEL"].AsInt;
        TUT_POPUPS_SHOWN        = (TUTORIALPOPUPS)json_data["TUT_POPUPS_SHOWN"].AsInt;
        BROKEN_TRASH_DOORS      = (TRASHDOORS)json_data["BROKEN_TRASH_DOORS"].AsInt;    //Steve did I do this right?
    }
 public bool IsLargeTrashDiscovered(LARGEGARBAGE large_garbage_type)
 {
     return((LARGE_GARBAGE_DISCOVERED & large_garbage_type) == large_garbage_type);
 }