Beispiel #1
0
 override public void SelfLoading(Calback calback)
 {
     if (ES3.KeyExists(gameObject.name + "Position", ObjectData.FileName) && ES3.KeyExists(gameObject.name + "Rotation", ObjectData.FileName))
     {
         transform.position = ES3.Load <Vector3>(gameObject.name + "Position", ObjectData.FileName);
         transform.rotation = ES3.Load <Quaternion>(gameObject.name + "Rotation", ObjectData.FileName);
         calback();
     }
 }
Beispiel #2
0
    public void SetInformation(SpeechData speechData, float openSpeed, float closeSpeed, float textFadeSpeed, Calback _callback)
    {
        WordData[] firstLineText, secondLineText;
        speechData.CreateScript(out firstLineText, out secondLineText, out hasSecondLine);

        this.textFadeSpeed = textFadeSpeed;
        this.speechData    = speechData;
        this.callback      = _callback;

        bubbleOpenSpeed  = openSpeed;
        bubbleCloseSpeed = closeSpeed;

        parts = new Transform[transform.childCount];
        int j;

        for (j = 0; j < transform.childCount - 1; j++)
        {
            parts[j] = transform.GetChild(j);
            if (speechData.partSprite[j])
            {
                parts[j].GetComponent <SpriteRenderer>().sprite = speechData.partSprite[j];
            }
        }
        parts[j] = transform.GetChild(j);

        for (int i = 0; i < firstLineText.Length; i++)
        {
            firstLineQueue.Enqueue(firstLineText[i]);
        }
        for (int i = 0; i < secondLineText.Length; i++)
        {
            secondLineQueue.Enqueue(secondLineText[i]);
        }

        if (!hasSecondLine)
        {
            bubbleWidth  = firstLineText.Length * speechData.wordSize.x;
            bubbleHeight = speechData.wordSize.y + speechData.padding.y + speechData.padding.w;
        }
        else
        {
            bubbleWidth  = (firstLineText.Length > secondLineText.Length) ? firstLineText.Length : secondLineText.Length;
            bubbleWidth *= speechData.wordSize.x;
            bubbleHeight = speechData.wordSize.y * 2 + speechData.lineSpacing + speechData.padding.y + speechData.padding.w;
        }

        StartCoroutine(ShowAnim());
    }
Beispiel #3
0
        public Bitmap BitmapChanger(Bitmap bmp, Calback calback)
        {
            int width;
            int height;

            for (width = 0; width < bmp.Width; width++)
            {
                for (height = 0; height < bmp.Height; height++)
                {
                    Color prevColor = bmp.GetPixel(width, height);
                    Color newColor  = Color.FromArgb(255 - prevColor.R, 255 - prevColor.G, 255 - prevColor.B);
                    bmp.SetPixel(width, height, newColor);

                    int progress = (width * height * 100) / (bmp.Width * bmp.Height);
                    calback(progress);
                }
            }

            return(bmp);
        }
Beispiel #4
0
    IEnumerator I_FadeOut(float fadeTime, Calback done = null)
    {
        float t = 0;

        Fade.enabled = true;
        Color originColor = Fade.color;

        while (t < fadeTime)
        {
            t += Time.deltaTime;
            float lerpValue = Mathf.Lerp(0, 1, t / fadeTime);
            originColor.a = lerpValue;
            Fade.color    = originColor;
            yield return(null);
        }
        Fade.enabled = false;
        if (done != null)
        {
            done();
        }
    }
Beispiel #5
0
 override public void Interaction(Calback _callback)
 {
     callback = _callback;
     Done();
     StartCoroutine(RotateImage());
 }
Beispiel #6
0
 override public void Interaction(Calback _callback)
 {
     callback = _callback;
     Done();
     gameObject.SetActive(false);
 }
Beispiel #7
0
 abstract public void SelfLoading(Calback calback);
Beispiel #8
0
 abstract public void SelfSaving(Calback calback);
Beispiel #9
0
 override public void Interaction(Calback _callback)
 {
     callback = _callback;
     Done();
     StartCoroutine("Moving");
 }
Beispiel #10
0
 virtual public void Interaction(Calback _callback)
 {
     callback = _callback;
 }
Beispiel #11
0
 override public void SelfSaving(Calback calback)
 {
     ES3.Save <Vector3>(gameObject.name + "Position", transform.position, ObjectData.FileName);
     ES3.Save <Quaternion>(gameObject.name + "Rotation", transform.rotation, ObjectData.FileName);
     calback();
 }
Beispiel #12
0
 public void FadeOut(float fadeTime, Calback done = null)
 {
     StartCoroutine(I_FadeOut(fadeTime, done));
 }
Beispiel #13
0
 override public void Interaction(Calback _callback)
 {
     callback = _callback;
     StartCoroutine("Falling");
 }