Ejemplo n.º 1
0
 void OnDestroy()
 {
     if (I == this)
     {
         I = null;
     }
     DOTween.Kill(TweenId);
 }
Ejemplo n.º 2
0
 void Awake()
 {
     I = this;
     if (Cam == null)
     {
         Cam  = Camera.main;
         CamT = Cam.transform;
         var tutorialMask = 1 << LayerMask.NameToLayer("TutorialUI");
         Cam.cullingMask = I.Cam.cullingMask | tutorialMask;
     }
 }
Ejemplo n.º 3
0
 public void Show(Transform _parent, Vector3 _position, bool _overlayed = true)
 {
     Reset();
     this.transform.parent = _parent;
     this.transform.LookAt(transform.position + TutorialUI.I.CamT.rotation * Vector3.forward, TutorialUI.I.CamT.up);
     this.transform.position   = _position;
     this.transform.localScale = Vector3.one * TutorialUI.GetCameraBasedScaleMultiplier(_position);
     this.gameObject.SetActive(true);
     Img.sortingOrder = _overlayed ? defSortingOrder : 0;
     ShowTween.PlayForward();
 }
Ejemplo n.º 4
0
 public void Spawn(Vector3 _position, bool _overlayed)
 {
     Init();
     this.gameObject.SetActive(true);
     this.transform.position = _position;
     this.transform.rotation = Quaternion.identity;
     lastPos = _position - Vector3.one;
     for (int i = 0; i < Trails.Length; ++i)
     {
         TrailRenderer tr = Trails[i];
         tr.startWidth   = defStartWidths[i] * TutorialUI.GetCameraBasedScaleMultiplier(_position);
         tr.endWidth     = defEndWidths[i] * TutorialUI.GetCameraBasedScaleMultiplier(_position);
         tr.sortingOrder = _overlayed ? defSortingOrder[i] : 0;
         tr.Clear();
     }
 }
Ejemplo n.º 5
0
        protected override void Awake()
        {
            base.Awake();

            awakeDone = true;

            ShowTween.Kill();
            Img.transform.localScale = setImgSize;
            Img.SetAlpha(0);
            ShowTween = DOTween.Sequence().SetAutoKill(false).Pause()
                        .Append(Img.DOFade(1, 0.2f))
                        .Join(this.transform.DOPunchScale(Vector3.one * 0.4f * TutorialUI.GetCameraBasedScaleMultiplier(this.transform.position),
                                                          0.4f, 10, 0))
                        .Join(this.transform.DOPunchRotation(new Vector3(0, 0, 30), 0.4f))
                        .Append(Img.transform.DOLocalRotate(new Vector3(0, 0, -10), 0.7f).SetEase(Ease.Linear))
                        .Insert(0.8f, this.transform.DOScale(0.0001f, 0.3f).SetEase(Ease.InBack))
                        .OnComplete(() =>
            {
                this.gameObject.SetActive(false);
                this.transform.parent = DefParent;
            });
        }