Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IEnumerator CorutineName(float time)
- {
- for (float t = 0; t < 1; t += Time.deltaTime / time)
- {
- //For moving object to a position to another in time
- transform.position = Vector3.Lerp(beginPos, endPos, t);
- //Modifing transparency of black image (from transparent to opaque)
- selectedImage.color = new Color(0.0f,0.0f,0.0f,Mathf.Lerp(0.0f,1.0f,t));
- //Modifing transparency of canvas group (from transparent to opaque)
- canvasGroup.alpha = Mathf.Lerp(0.0f,1.0f,t);
- yield return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement