示例#1
0
    public void Remove()
    {
        if (m_used)
        {
            return;
        }

        POIInfo.Stop();
        POIInfo = Tweener.Start(new FloatTweenSettings
        {
            duration  = 1f,
            from      = 0,
            to        = 1,
            easing    = Interpolations.Sinusoidal.InOut,
            onChanged = (amt) =>
            {
                transform.localPosition = Vector3.Lerp(transform.localPosition, transform.localPosition + new Vector3(0, 0, 0.0002f), amt);
                transform.eulerAngles   = Vector3.Lerp(transform.eulerAngles, transform.eulerAngles + new Vector3(0, 0, -360f), amt);
            },
            onFinished = (amt) =>
            {
                GetComponent <Rigidbody>().isKinematic = false;
                m_used = true;
                m_gameState.AddScrew();
            }
        }, this);
    }
示例#2
0
 protected virtual void ShowAnnotation()
 {
     m_annotationInfo.Stop();
     m_annotationInfo = Tweener.Start(new FloatTweenSettings
     {
         duration  = 0.2f,
         from      = 1f,
         to        = 1,
         easing    = Interpolations.Sinusoidal.InOut,
         onChanged = (amt) =>
         {
             m_annotation.GetComponent <CanvasGroup>().alpha = amt;
             m_text.alpha = amt;
         },
     }, this);
 }
示例#3
0
    public virtual void GetGrabbed(Transform grabber)
    {
        GrabAction(grabber);

        m_transformInfo.Stop();
        m_transformInfo = Tweener.Start(new FloatTweenSettings
        {
            duration  = 0.5f,
            from      = 0,
            to        = 1,
            easing    = Interpolations.Sinusoidal.InOut,
            onChanged = (amt) =>
            {
                transform.position = Vector3.Lerp(transform.position, grabber.position, amt);
                transform.forward  = Vector3.Lerp(transform.forward, grabber.forward, amt);
            }
        }, this);
    }
示例#4
0
 public void OpenDoor()
 {
     m_openDoor.Stop();
     m_openDoor = Tweener.Start(new FloatTweenSettings
     {
         duration  = 2f,
         from      = 0,
         to        = 1,
         easing    = Interpolations.Linear,
         onChanged = (amt) =>
         {
             transform.position = Vector3.Lerp(transform.position, transform.position - new Vector3(0.33f, 0, 0), amt);
         }
     }, this);
 }
示例#5
0
    public void Open()
    {
        if (m_used)
        {
            return;
        }

        POIInfo.Stop();
        POIInfo = Tweener.Start(new FloatTweenSettings
        {
            duration  = 1f,
            from      = 0,
            to        = 1,
            easing    = Interpolations.Sinusoidal.InOut,
            onChanged = (amt) =>
            {
                m_pivot.localEulerAngles = Vector3.Lerp(m_pivot.localEulerAngles, new Vector3(0, 0, 60f), amt);
            },
            onFinished = (amt) =>
            {
                m_used = true;
            }
        }, this);
    }