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(); } }
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()); }
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); }
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(); } }
override public void Interaction(Calback _callback) { callback = _callback; Done(); StartCoroutine(RotateImage()); }
override public void Interaction(Calback _callback) { callback = _callback; Done(); gameObject.SetActive(false); }
abstract public void SelfLoading(Calback calback);
abstract public void SelfSaving(Calback calback);
override public void Interaction(Calback _callback) { callback = _callback; Done(); StartCoroutine("Moving"); }
virtual public void Interaction(Calback _callback) { callback = _callback; }
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(); }
public void FadeOut(float fadeTime, Calback done = null) { StartCoroutine(I_FadeOut(fadeTime, done)); }
override public void Interaction(Calback _callback) { callback = _callback; StartCoroutine("Falling"); }