Ejemplo n.º 1
0
        public IEnumerator ListenForSelfie(SelfieTarget target, float requiredTime)
        {
            var progressIndicator = GameObject.Instantiate(SelfieProgressIndicatorPrefab).GetComponent <SelfieProgressIndicator>();

            progressIndicator.Init(Player.Instance);
            progressIndicator.SetTarget(target);
            bool inSelfie = target.IsInSelfie;

            progressIndicator.SetVisible(inSelfie);
            while (true)
            {
                float lerp = Mathf.InverseLerp(0, requiredTime, target.SelfieTime);
                if (target.IsInSelfie != inSelfie)
                {
                    inSelfie = target.IsInSelfie;
                    progressIndicator.SetVisible(inSelfie);
                }
                if (inSelfie)
                {
                    progressIndicator.SetProgress(lerp);
                }
                if (lerp >= 1)
                {
                    break;
                }
                progressIndicator.SetTarget(target);
                yield return(null);
            }
            GameObject.Destroy(progressIndicator);
        }
Ejemplo n.º 2
0
 public IEnumerator ListenForSelfie(SelfieTarget selfieTarget)
 {
     return(ListenForSelfie(selfieTarget, defaultSelfieTime));
 }
Ejemplo n.º 3
0
 public void SetTarget(SelfieTarget target)
 {
     transform.position = target.IndicatorPoint;
 }