mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 11:57:40 +02:00
Remove Unneeded RenderTextures (#399)
* remove unneeded render textures * remove debug print * show build guid in parts of app * adjust timing window
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
|
||||
public static class AppInfo {
|
||||
public const string Version = "0.0.968";
|
||||
public static readonly DateTime Date = new DateTime(2023, 02, 09, 01, 03, 08, 186, DateTimeKind.Utc);
|
||||
public const string Version = "0.0.969";
|
||||
public static readonly DateTime Date = new DateTime(2023, 04, 23, 17, 57, 04, 196, DateTimeKind.Utc);
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,6 +30,7 @@ namespace HeavenStudio
|
||||
public static Vector3 defaultPosition = new Vector3(0, 0, -10);
|
||||
public static Vector3 defaultRotEluer = new Vector3(0, 0, 0);
|
||||
public static Vector3 defaultShake = new Vector3(0, 0, 0);
|
||||
public static float defaultFoV = 53.15f;
|
||||
|
||||
/**
|
||||
camera's current transformation
|
||||
@ -53,6 +54,7 @@ namespace HeavenStudio
|
||||
public static Vector3 additionalPosition;
|
||||
public static Vector3 additionalRotEluer;
|
||||
public static Vector3 additionalScale;
|
||||
public static float additionalFoV;
|
||||
|
||||
[Header("Components")]
|
||||
public Color baseColor;
|
||||
@ -109,8 +111,11 @@ namespace HeavenStudio
|
||||
SetShakeIntensity();
|
||||
|
||||
Camera cam = GetCamera();
|
||||
cam.transform.localPosition = position + additionalPosition + shakeResult;
|
||||
// rotate position by additional rotation
|
||||
Vector3 userPos = Quaternion.Euler(additionalRotEluer) * position;
|
||||
cam.transform.localPosition = userPos + additionalPosition + shakeResult;
|
||||
cam.transform.eulerAngles = rotEluer + additionalRotEluer;
|
||||
cam.fieldOfView = additionalFoV;
|
||||
}
|
||||
|
||||
private void UpdateCameraTranslate()
|
||||
@ -238,6 +243,7 @@ namespace HeavenStudio
|
||||
{
|
||||
additionalPosition = new Vector3(0, 0, 0);
|
||||
additionalRotEluer = new Vector3(0, 0, 0);
|
||||
additionalFoV = defaultFoV;
|
||||
}
|
||||
|
||||
public static Camera GetCamera()
|
||||
|
@ -53,12 +53,11 @@ namespace HeavenStudio.Games
|
||||
public enum BTSObject { HitPieces, MissPieces, FlyingRod }
|
||||
|
||||
[Header("Camera")]
|
||||
public Transform renderQuadTrans;
|
||||
public Transform camPivot;
|
||||
public Camera camComp;
|
||||
[SerializeField] Transform camPos;
|
||||
[SerializeField] float cameraFoV;
|
||||
|
||||
[Header("References")]
|
||||
public SkinnedMeshRenderer environmentRenderer;
|
||||
[SerializeField] SkinnedMeshRenderer environmentRenderer;
|
||||
public GameObject flyingRodBase;
|
||||
public GameObject movingBlocksBase;
|
||||
public GameObject hitPartsBase;
|
||||
@ -69,7 +68,7 @@ namespace HeavenStudio.Games
|
||||
public Animator elevatorAnim;
|
||||
|
||||
[Header("Properties")]
|
||||
public float beltSpeed = 1f;
|
||||
[SerializeField] float beltSpeed = 1f;
|
||||
|
||||
private Material beltMaterial;
|
||||
private Material[] environmentMaterials;
|
||||
@ -87,18 +86,17 @@ namespace HeavenStudio.Games
|
||||
environmentMaterials = environmentRenderer.materials;
|
||||
beltMaterial = Instantiate(environmentMaterials[8]);
|
||||
environmentMaterials[8] = beltMaterial;
|
||||
renderQuadTrans.gameObject.SetActive(true);
|
||||
|
||||
var cam = GameCamera.instance.camera;
|
||||
var camHeight = 2f * cam.orthographicSize;
|
||||
var camWidth = camHeight * cam.aspect;
|
||||
renderQuadTrans.localScale = new Vector3(camWidth, camHeight, 1f);
|
||||
|
||||
camComp.depthTextureMode = camComp.depthTextureMode | DepthTextureMode.Depth;
|
||||
|
||||
elevatorAnim.Play("MakeRod", 0, 1f);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
GameCamera.additionalPosition = camPos.position + (Quaternion.Euler(camPos.eulerAngles) * Vector3.forward * 10f);
|
||||
GameCamera.additionalRotEluer = camPos.eulerAngles;
|
||||
GameCamera.additionalFoV = cameraFoV;
|
||||
}
|
||||
|
||||
List<DynamicBeatmap.DynamicEntity> spawnedBlockEvents = new List<DynamicBeatmap.DynamicEntity>();
|
||||
void Update()
|
||||
{
|
||||
|
@ -334,7 +334,6 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
if (path.name == name)
|
||||
{
|
||||
Debug.Log("Found path " + name);
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
public class Minigame : MonoBehaviour
|
||||
{
|
||||
public static double earlyTime = 0.07f, perfectTime = 0.04f, aceEarlyTime = 0.01f, aceLateTime = 0.01f, lateTime = 0.04f, endTime = 0.07f;
|
||||
public static double earlyTime = 0.075f, perfectTime = 0.06f, aceEarlyTime = 0.01f, aceLateTime = 0.01f, lateTime = 0.06f, endTime = 0.075f;
|
||||
public static float rankHiThreshold = 0.8f, rankOkThreshold = 0.6f;
|
||||
[SerializeField] public SoundSequence.SequenceKeyValue[] SoundSequences;
|
||||
|
||||
|
@ -112,9 +112,9 @@ namespace HeavenStudio.Games
|
||||
public enum RallySpeed { Slow, Normal, Fast, SuperFast }
|
||||
|
||||
[Header("Camera")]
|
||||
public Transform renderQuadTrans;
|
||||
public Transform cameraPivot;
|
||||
|
||||
[SerializeField] Transform cameraPivot;
|
||||
[SerializeField] Transform cameraPos;
|
||||
[SerializeField] float cameraFOV;
|
||||
|
||||
[Header("Ball and curve info")]
|
||||
public GameObject ball;
|
||||
@ -155,12 +155,6 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
instance = this;
|
||||
paddlers.Init();
|
||||
renderQuadTrans.gameObject.SetActive(true);
|
||||
|
||||
var cam = GameCamera.instance.camera;
|
||||
var camHeight = 2f * cam.orthographicSize;
|
||||
var camWidth = camHeight * cam.aspect;
|
||||
renderQuadTrans.localScale = new Vector3(camWidth, camHeight, 1f);
|
||||
|
||||
playerAnim.Play("Idle", 0, 0);
|
||||
opponentAnim.Play("Idle", 0, 0);
|
||||
@ -180,9 +174,6 @@ namespace HeavenStudio.Games
|
||||
var playerState = playerAnim.GetCurrentAnimatorStateInfo(0);
|
||||
var opponentState = opponentAnim.GetCurrentAnimatorStateInfo(0);
|
||||
|
||||
bool playerPrepping = false; // Player using prep animation?
|
||||
bool opponentPrepping = false; // Opponent using prep animation?
|
||||
|
||||
if (started)
|
||||
{
|
||||
// Determine hitBeat and beatDurs.
|
||||
@ -319,13 +310,11 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
if (served)
|
||||
{
|
||||
playerPrepping = true;
|
||||
if ((playerState.IsName("Swing") && playerAnim.IsAnimationNotPlaying()) || (!playerState.IsName("Swing") && !playerState.IsName("Ready1")))
|
||||
playerAnim.Play("Ready1");
|
||||
}
|
||||
else if (!opponentServing)
|
||||
{
|
||||
opponentPrepping = true;
|
||||
if ((opponentState.IsName("Swing") && opponentAnim.IsAnimationNotPlaying()) || (!opponentState.IsName("Swing") && !opponentState.IsName("Ready1")))
|
||||
{
|
||||
opponentAnim.Play("Ready1");
|
||||
@ -367,6 +356,11 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
|
||||
opponentServing = false;
|
||||
|
||||
//update camera
|
||||
GameCamera.additionalPosition = cameraPos.position + (Quaternion.Euler(cameraPos.rotation.eulerAngles) * Vector3.forward * 10f);
|
||||
GameCamera.additionalRotEluer = cameraPos.rotation.eulerAngles;
|
||||
GameCamera.additionalFoV = cameraFOV;
|
||||
}
|
||||
|
||||
public void Bop(float beat, float length, bool bop, bool bopAuto)
|
||||
|
@ -98,16 +98,18 @@ namespace HeavenStudio
|
||||
Init();
|
||||
DontDestroyOnLoad(this.gameObject);
|
||||
instance = this;
|
||||
Starpelly.OS.ChangeWindowTitle("Heaven Studio DEMO");
|
||||
QualitySettings.maxQueuedFrames = 1;
|
||||
PlayerInput.InitInputControllers();
|
||||
#if UNITY_EDITOR
|
||||
Starpelly.OS.ChangeWindowTitle("Heaven Studio UNITYEDITOR ");
|
||||
buildTime = "(EDITOR) " + System.DateTime.UtcNow.ToString("dd/MM/yyyy hh:mm:ss");
|
||||
#else
|
||||
buildTime = AppInfo.Date.ToString("dd/MM/yyyy hh:mm:ss");
|
||||
Starpelly.OS.ChangeWindowTitle("Heaven Studio (INDEV) " + Application.buildGUID.Substring(0, 8));
|
||||
buildTime = Application.buildGUID.Substring(0, 8) + " " + AppInfo.Date.ToString("dd/MM/yyyy hh:mm:ss");
|
||||
#endif
|
||||
}
|
||||
|
||||
// todo: make this part of the camera prefab instead of generated in code
|
||||
public static GameObject CreateFade()
|
||||
{
|
||||
GameObject fade = new GameObject();
|
||||
|
Reference in New Issue
Block a user