Esempio n. 1
0
    public static void SaveEvent(EventSaveFile ev)
    {
        if (!Directory.Exists(Application.persistentDataPath + "/events"))
        {
            Directory.CreateDirectory(Application.persistentDataPath + "/events");
        }
        savedEvents.Add(ev);
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/events/events.ev");

        bf.Serialize(file, SaveLoad.savedEvents);
        file.Close();
        Debug.Log("Event saved");
    }
Esempio n. 2
0
    private void saveEvent()
    {
        esf                  = new EventSaveFile();
        esf.effect           = evText;
        esf.stateTriggerkey  = statekey1;
        esf.state            = state1;
        esf.stateTriggerKey2 = statekey2;
        esf.state2           = state2;
        esf.coolDownTime     = cooldown;
        esf.eventName        = name;
        esf.inrangeneed      = needstobeinrange;

        SaveLoad.SaveEvent(esf);
    }
Esempio n. 3
0
    public static void removeEvent(string name)
    {
        EventSaveFile removeMe = null;

        foreach (EventSaveFile esf in savedEvents)
        {
            if ((esf.eventName.ToLower()).Equals(name.ToLower()))
            {
                removeMe = esf;
            }
        }
        if (removeMe != null)
        {
            savedEvents.Remove(removeMe);
            Debug.Log("Event removed");
            internalSave();
        }
        else
        {
            Debug.Log("Didn't find event to remove");
        }
    }