Ejemplo n.º 1
0
    /// <summary>
    /// The Save Data is not Found, or the player decides to play a new turn. Create the variables to avoid a possible Object Reference Bla Bla Bla ...
    /// </summary>
    private IEnumerator Create()
    {
        yield return(new WaitForEndOfFrame());

        InfoSaver.CreateNewSaveData();
        yield return(StartCoroutine(UIController.FadeInOut(FadeOperation.FadeOut)));
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Gets the item by ID.
    /// </summary>
    /// <returns>The reminder item by ID.</returns>
    /// <param name="idx">Index.</param>
    public static ReminderItem GetItemByID(int idx)
    {
        string itemString = InfoSaver.GetStringFromResource(FileName.ReminderItem, idx);

        string[] splitted = itemString.Split(' ');
        return(new ReminderItem(idx, int.Parse(splitted[0]), int.Parse(splitted[1]), splitted[2], splitted[3]));
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     dwayne     = GameObject.Find("Dwayne");
     canvas     = GameObject.Find("Canvas");
     infoSaver  = GameObject.Find("Info Saver");
     infs       = infoSaver.GetComponent <InfoSaver> ();
     extraWords = extraText.GetComponent <Text> ();
 }
Ejemplo n.º 4
0
    /// <summary>
    /// Gets the item by Index.
    /// </summary>
    /// <returns>The usable item by the specified Index.</returns>
    /// <param name="idx">Index.</param>
    public static UsableItem GetItemByID(int idx)
    {
        string itemString = InfoSaver.GetStringFromResource(FileName.PermamnentItem, idx);

        string[]   splitted = itemString.Split(' ');
        UsableItem retItem  = new UsableItem(idx, splitted[0], splitted[1], splitted[2], splitted[3]);

        return(retItem);
    }
Ejemplo n.º 5
0
 public void LastImage()
 {
     if (CurrentIndex <= 1)
     {
         return;
     }
     CurrentIndex--;
     InfoSaver.GetGalleryTextureByID(mainTexure, CurrentIndex);
 }
Ejemplo n.º 6
0
 public void NextImage()
 {
     if (CurrentIndex == imageNumber)
     {
         return;
     }
     CurrentIndex++;
     InfoSaver.GetGalleryTextureByID(mainTexure, CurrentIndex);
 }
Ejemplo n.º 7
0
 public void DeleteCurrentImage()
 {
     if (CurrentIndex == imageNumber)
     {
         CurrentIndex--;
     }
     imageNumber--;
     StartCoroutine(InfoSaver.GalleryDeleteImageByID(mainTexure, CurrentIndex));
 }
Ejemplo n.º 8
0
 //Awake function checks whether the static singleton exists. If not, create one!
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         DestroyImmediate(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Ejemplo n.º 9
0
    public IEnumerator AddNewImageByScreenShot()
    {
        yield return(new WaitForEndOfFrame());

        InfoSaver.TakeScreenShot();
        imageNumber++;
        if (CurrentIndex == 0)
        {
            CurrentIndex = 1;
            InfoSaver.GetGalleryTextureByID(mainTexure, currentIndex);
        }
    }
Ejemplo n.º 10
0
 //Please do not leave malicious comments on this part ... after all this is the by-product of the DialogueLua Environment!
 //(I WILL NEVER USE THIS SYSTEM AGAIN!)
 //Acturally only update REMINDERS. Conclusions and truths could not be received directly.
 private IEnumerator ContentUpdate()
 {
     while (true)
     {
         foreach (int varName in variablesToCheck)
         {
             if (DialogueLua.GetVariable(Consts.VariableName.reminderState + varName).AsBool)
             {
                 variablesToCheck.Remove(varName);
                 UnlockNewContent(ContentType.Reminder, Consts.FileName.reminders, varName);
                 InfoSaver.SaveLuaEnvironment();
             }
         }
         yield return(UPDATE_TIME);
     }
 }
    // Use this for initialization
    void Start()
    {
        finalFilePath = Application.dataPath + "/" + fileName;


        if (infosaver == null)
        {
            infosaver = this;
            DontDestroyOnLoad(this);
        }
        else
        {
            Destroy(gameObject);
        }

        timer = GameObject.Find("Timer");
        s     = timer.GetComponent <Scoring> ();
    }
Ejemplo n.º 12
0
    public static void UnlockNewContent(ContentType type, string targetFileName, int number)
    {
        string contentText = InfoSaver.GetStringFromResource(targetFileName, number);

        //!!!!!!UNSAFE coding way. Please make sure that the targetFile is absolutely correct!!!!!!
        string[] lineComponents  = contentText.Split('#');
        int      index           = number;
        string   title           = lineComponents[0];
        string   content         = lineComponents[1];
        int      higher          = ((type == ContentType.Truth) ? -1 : int.Parse(lineComponents[2]));
        int      another         = ((type == ContentType.Truth) ? -1 : int.Parse(lineComponents[3]));
        int      another2        = ((type == ContentType.Truth) ? -1 : int.Parse(lineComponents[4]));
        Content  newContentEntry = new Content(type, title, content, index, another, another2, higher);
        //To be CONTINUED : WRITE A NEW CONTENT CLASS AND IMPLEMENT ITS INITIALIZER, THEN ADD IT HERE!!!!
        UIGrid targetTable = null;

        switch (type)
        {
        case ContentType.Reminder:
            targetTable = instance.reminderTable;
            break;

        case ContentType.Conclusion:
            targetTable = instance.conclusionTable;
            break;

        case ContentType.Truth:
            targetTable = instance.truthTable;
            break;

        default:
            break;
        }
        GameObject  targetContent = NGUITools.AddChild(targetTable.gameObject, instance.contentPrefab);
        ContentLine targetLine    = targetContent.GetComponent <ContentLine>();

        targetLine.Initialize(newContentEntry);
    }