void Update() { transform.position = positionTween.Update(transform.position); if (!positionTween.active) { PacketGraphicManager.RemovePacket(this); } float scaleOffset = Mathf.Sin((Time.time - lifeTime) / graphic_pulseFrequency) * graphic_pulseMagnitude; transform.localScale = startScale + (startScale * scaleOffset); transform.Rotate(spin); }
/// <summary> /// Updates the animation /// </summary> /// <param name="gameTime"></param> public void Update(GameTime gameTime) { if (currentTransition != null) { switch (kindOfAnimation) { case VariableToAnimate.floatValue: singleValueTweener.Update(gameTime); break; case VariableToAnimate.Vector2Value: vectorTwoTweener.Update(gameTime); break; case VariableToAnimate.Vector3Value: vector3Tweener.Update(gameTime); break; default: vector3Tweener.Update(gameTime); break; } } }
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() { // Update Position transform.position = positionTween.Update(transform.position); // Scale Pulse float scaleOffset = Mathf.Sin((Time.time - lifeTime) / graphic_pulseFrequency) * graphic_pulseMagnitude; sphere.localScale = originalScale + (originalScale * scaleOffset); // Lock rotation to camera transform.rotation = GameManager.FindPlayer(GameManager.activeConsole).cameraFocus.transform.localRotation; // Update Log Text if (logBox.gameObject.activeSelf) { logText.text = GetLogText(); } UpdateMemory(); }
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(); }