// Use this for initialization
 void Start()
 {
     if (God.GetCurrentLevel() == GameConstants.BRING_CAT_HINT_LEVEL)
     {
         hintToBringCat = true;
     }
 }
Beispiel #2
0
    public void ReloadCurrentLevel()
    {
        God.GetStats().incrementStat("attempts", 1);
        God.GetStats().SendData();

        LoadLevel(God.GetCurrentLevel(), false);
        // Handle if we want story to reset as well
        // Should hint level remain?
    }
Beispiel #3
0
 public bool Interact(Cat c)
 {
     c.catInventory.Add(this);
     if (God.GetCurrentLevel() == GameConstants.BRING_CAT_HINT_LEVEL)
     {
         God.ShowText(HintsList.CAT_GOT_KEY);
     }
     return(true);
 }
Beispiel #4
0
 public void ToggleDoorState()
 {
     if (God.GetCurrentLevel() == GameConstants.FIRST_YARN_LEVEL)
     {
         God.ShowText(HintsList.NO_YARN_PERSIST);
     }
     if (IsOpen)
     {
         CloseDoor();
     }
     else
     {
         OpenDoor();
     }
 }
Beispiel #5
0
    Dictionary <string, Dictionary <string, string> > Unload()
    {
        IPersistantObject[] mapObjects = GetMapPersistantObjects();
        PreSave(mapObjects);
        Level newPlaythroughVersion = new Level(God.GetCurrentLevel());
        Dictionary <string, Dictionary <string, string> > levelState = new Dictionary <string, Dictionary <string, string> >();
        Dictionary <string, Dictionary <string, string> > carrying   = new Dictionary <string, Dictionary <string, string> >();

        foreach (IPersistantObject ip in mapObjects)
        {
            Dictionary <string, string> saved = ip.Save();
            Dictionary <string, string> carry = new Dictionary <string, string>();

            bool shouldAdd = false;
            IEnumerable <string> toPersist  = ip.PersistThroughLoad();
            List <string>        toPersistL = toPersist.ToList();
            foreach (string carriedKey in toPersistL)
            {
                if (saved.ContainsKey(carriedKey))
                {
                    carry.Add(carriedKey, saved[carriedKey]);
                }
                shouldAdd = true;
            }
            carry.Add("type", ip.GetPType().ToString());
            //carry.Add("transform", ip.GetMono().transform.ToSavableString());
            if (shouldAdd)
            {
                carrying.Add(ip.getID(), carry);
            }
        }
        foreach (IPersistantObject ip in mapObjects)
        {
            ip.Unload();
        }
        return(carrying);
    }