Exemple #1
0
        protected void UpdateTweeners()
        {
            if (state == AudioStates.Stopped)
            {
                return;
            }

            rampVolumeTweener.Update();
            rampParentVolumeTweener.Update();
            rampPitchTweener.Update();
            rampParentPitchTweener.Update();
            fadeTweener.Update();
        }
    void Update()
    {
        // Tweens
        transform.position = positionTween.Update(transform.position);
        childCamera.transform.localPosition = new Vector3(0, 0, zoomTween.Update(childCamera.transform.localPosition.z));
        offset.localPosition = offsetTween.Update(offset.localPosition);

        if (Time.time <= rotateStartTime + rotateMoveDuration)
        {
            transform.localRotation = TweenRotate(Time.time - rotateStartTime);
        }
        else
        {
            transform.Rotate(spin);
        }
    }
    void Update()
    {
        Color newColor = image.color;

        newColor.a  = fadeTween.Update(newColor.a);
        image.color = newColor;

        if (state == 0 && Time.time >= startTime + fadeInTime)
        {
            fadeTween.StartTween(0, 1, fadeDuration);
            state = 1;
        }
        else if (state == 1 && Time.time >= startTime + fadeOutTime)
        {
            fadeTween.StartTween(1, 0, fadeDuration);
            state = 2;
        }
    }
Exemple #4
0
    void UpdateMemory()
    {
        if (!memory.gameObject.activeSelf)
        {
            return;
        }

        // Hide/unhide memory
        memory.localScale = scaleTween.Update(memory.localScale);

        if (!scaleTween.active)
        {
            if (memoryIsHidden)
            {
                memory.gameObject.SetActive(false);
                memoryData.localRotation = Quaternion.identity;
            }

            memoryData.localRotation = Quaternion.Euler(memoryData.localEulerAngles.x,
                                                        rotateTween.Update(memoryData.localEulerAngles.y),
                                                        memoryData.localEulerAngles.z);
            if (!rotateTween.active && freeRotate)
            {
                // Spin
                memoryData.Rotate(transform.up, rotationSpeed, Space.World);
            }
        }

        // Scale pulse memory cubes
        for (int i = 0; i < memoryData.childCount; i++)
        {
            float cubeAge     = (Time.time - lifeTime) + (i * 100);
            float scaleOffset = Mathf.Sin(cubeAge / memory_pulseFrequency) * memory_pulseMagnitude;
            memoryData.GetChild(i).localScale = memoryCubeOriginalScale + (memoryCubeOriginalScale * scaleOffset);
            memoryData.GetChild(i).GetComponent <MeshRenderer>().material.SetColor("_EmissionColor", memoryBaseColor);
        }

        // Set MemoryRead text
        GetMemoryText();
    }