rev 0.4, dev panel

This commit is contained in:
2026-02-05 06:32:52 +05:30
parent 803e186bcc
commit df77848ca5
19 changed files with 3635 additions and 93 deletions

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e616d32bb51bedf49bdcd96c1c17265d
guid: fd22d178819da30458d827b137782704
folderAsset: yes
DefaultImporter:
externalObjects: {}

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 4e8594bd03f396a41a133b945ae68a45
TextScriptImporter:
guid: 8a2d41f1b69ce0342b114b6595320207
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:

View File

@@ -439,7 +439,7 @@ Transform:
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.199, y: -1.166, z: 0}
m_LocalScale: {x: 0.64645, y: 0.64645, z: 0.64645}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 271728775783951194}
@@ -515,7 +515,7 @@ Rigidbody2D:
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 10
m_Mass: 20
m_LinearDamping: 2
m_AngularDamping: 2
m_GravityScale: 0
@@ -528,7 +528,7 @@ Rigidbody2D:
m_Bits: 0
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_CollisionDetection: 1
m_Constraints: 4
--- !u!58 &2738569492822449184
CircleCollider2D:

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
{"TestSuite":"","Date":0,"Player":{"Development":false,"ScreenWidth":0,"ScreenHeight":0,"ScreenRefreshRate":0,"Fullscreen":false,"Vsync":0,"AntiAliasing":0,"Batchmode":false,"RenderThreadingMode":"MultiThreaded","MtRendering":false,"GraphicsJobs":false,"GpuSkinning":false,"Platform":"","ColorSpace":"","AnisotropicFiltering":"","BlendWeights":"","GraphicsApi":"","ScriptingBackend":"IL2CPP","AndroidTargetSdkVersion":"AndroidApiLevelAuto","AndroidBuildSystem":"Gradle","BuildTarget":"Android","StereoRenderingPath":"MultiPass"},"Hardware":{"OperatingSystem":"","DeviceModel":"","DeviceName":"","ProcessorType":"","ProcessorCount":0,"GraphicsDeviceName":"","SystemMemorySizeMB":0},"Editor":{"Version":"6000.0.59f2","Branch":"6000.0/respin/6000.0.59f1-063c55f2fd0f","Changeset":"ef281c76c3c1","Date":1759317678},"Dependencies":["com.boxqkrtm.ide.cursor@2.0.27","com.unity.collab-proxy@2.11.3","com.unity.feature.2d@2.0.1","com.unity.ide.rider@3.0.38","com.unity.ide.visualstudio@2.0.23","com.unity.inputsystem@1.14.2","com.unity.multiplayer.center@1.0.0","com.unity.render-pipelines.universal@17.0.4","com.unity.test-framework@1.6.0","com.unity.timeline@1.8.9","com.unity.ugui@2.0.0","com.unity.visualscripting@1.9.7","com.unity.modules.accessibility@1.0.0","com.unity.modules.ai@1.0.0","com.unity.modules.androidjni@1.0.0","com.unity.modules.animation@1.0.0","com.unity.modules.assetbundle@1.0.0","com.unity.modules.audio@1.0.0","com.unity.modules.cloth@1.0.0","com.unity.modules.director@1.0.0","com.unity.modules.imageconversion@1.0.0","com.unity.modules.imgui@1.0.0","com.unity.modules.jsonserialize@1.0.0","com.unity.modules.particlesystem@1.0.0","com.unity.modules.physics@1.0.0","com.unity.modules.physics2d@1.0.0","com.unity.modules.screencapture@1.0.0","com.unity.modules.terrain@1.0.0","com.unity.modules.terrainphysics@1.0.0","com.unity.modules.tilemap@1.0.0","com.unity.modules.ui@1.0.0","com.unity.modules.uielements@1.0.0","com.unity.modules.umbra@1.0.0","com.unity.modules.unityanalytics@1.0.0","com.unity.modules.unitywebrequest@1.0.0","com.unity.modules.unitywebrequestassetbundle@1.0.0","com.unity.modules.unitywebrequestaudio@1.0.0","com.unity.modules.unitywebrequesttexture@1.0.0","com.unity.modules.unitywebrequestwww@1.0.0","com.unity.modules.vehicles@1.0.0","com.unity.modules.video@1.0.0","com.unity.modules.vr@1.0.0","com.unity.modules.wind@1.0.0","com.unity.modules.xr@1.0.0","com.unity.modules.subsystems@1.0.0","com.unity.modules.hierarchycore@1.0.0","com.unity.ext.nunit@2.0.5","com.unity.render-pipelines.core@17.0.4","com.unity.shadergraph@17.0.4","com.unity.render-pipelines.universal-config@17.0.3","com.unity.2d.animation@10.2.1","com.unity.2d.pixel-perfect@5.0.3","com.unity.2d.psdimporter@9.1.0","com.unity.2d.sprite@1.0.0","com.unity.2d.spriteshape@10.0.7","com.unity.2d.tilemap@1.0.0","com.unity.2d.tilemap.extras@4.1.0","com.unity.2d.aseprite@1.1.10","com.unity.searcher@4.9.3","com.unity.burst@1.8.25","com.unity.mathematics@1.3.2","com.unity.collections@2.5.1","com.unity.rendering.light-transport@1.0.1","com.unity.2d.common@9.1.1","com.unity.nuget.mono-cecil@1.11.4","com.unity.test-framework.performance@3.2.0"],"Results":[]}

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 5d0035bef0bb88648b0fb5aeff3487b9
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1 +0,0 @@
{"MeasurementCount":-1}

View File

@@ -1052,7 +1052,8 @@ PrefabInstance:
value: StatCanvas
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7261300650275389494, guid: 400992651824baf47abb64c18227c556, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 400992651824baf47abb64c18227c556, type: 3}

View File

@@ -1167,22 +1167,6 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 5896139376663135640, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_CollisionDetection
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalScale.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalPosition.x
value: 0.001
@@ -3756,22 +3740,6 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 5896139376663135640, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_CollisionDetection
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalScale.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalPosition.x
value: 0
@@ -4761,22 +4729,6 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 5896139376663135640, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_CollisionDetection
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalScale.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7377873967498557941, guid: c3a9beee82147c54b960a10faf404e0f, type: 3}
propertyPath: m_LocalPosition.x
value: 0.001
@@ -4873,7 +4825,7 @@ MonoBehaviour:
m_isMoving: 0
gameInputPanel: {fileID: 1302593952}
ball: {fileID: 2066222788}
puckForce: 5000
puckForce: 4000
puckForceCurve:
serializedVersion: 2
m_Curve:
@@ -4887,28 +4839,28 @@ MonoBehaviour:
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.7199071
value: 0.0064275246
inSlope: 0.5143833
outSlope: 0.5143833
time: 0.62684375
value: 0.000049350783
inSlope: 1.0135089
outSlope: 1.0135089
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
inWeight: 0.10950333
outWeight: 0.11989239
- serializedVersion: 3
time: 2.0207062
value: 0.5944911
inSlope: 0.296896
outSlope: 0.296896
value: 0.5966121
inSlope: 0.22439942
outSlope: 0.22439942
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
inWeight: 0.19836703
outWeight: 0.08967882
- serializedVersion: 3
time: 5.0033493
value: 0.9958832
inSlope: -0.007253413
outSlope: -0.007253413
inSlope: 0.09042641
outSlope: 0.09042641
tangentMode: 0
weightedMode: 0
inWeight: 0.09360156

View File

@@ -0,0 +1,57 @@
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
public class DevOptionItem : MonoBehaviour
{
public TMP_Text txtTitle;
public TMP_InputField inputMin, inputMax, inputValue;
public Slider slider;
public UnityAction<float> OnChanged;
void Awake()
{
inputMin.onEndEdit.AddListener(OnEndEditMin);
inputMax.onEndEdit.AddListener(OnEndEditMax);
inputValue.onEndEdit.AddListener(OnEndEditValue);
slider.onValueChanged.AddListener(OnValueChanged);
}
public void Setup(string title, float min, float max, float value){
txtTitle.text = title;
inputMin.text = min.ToString();
inputMax.text = max.ToString();
inputValue.text = value.ToString();
slider.minValue = min;
slider.maxValue = max;
slider.value = value;
}
void OnEndEditMin(string value){
float.TryParse(value, out float min);
slider.minValue = min;
}
void OnEndEditMax(string value){
float.TryParse(value, out float max);
slider.maxValue = max;
}
void OnEndEditValue(string value){
float parsedValue;
if (float.TryParse(value, out parsedValue)) {
slider.value = parsedValue;
}
}
void OnValueChanged(float value){
inputValue.text = value.ToString();
if (OnChanged != null) {
OnChanged.Invoke(value);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: fc8c3535b2249f247abdb4f3964eca7e

View File

@@ -0,0 +1,93 @@
using System;
using System.Collections;
using UnityEngine;
public class DevSettingsPanel : MonoBehaviour
{
public static Action OnChanged;
public static DevSettingsPanel instance;
public Transform contentParent;
public DevOptionItem devOptionItemPrefab;
void Awake()
{
instance = this;
}
void Start()
{
StartCoroutine(CoroutinePopulate());
}
IEnumerator CoroutinePopulate()
{
yield return new WaitForSeconds(1f); //Wait for the game manager to be initialized
Populate();
}
void Populate()
{
DevOptionItem puckForce = Instantiate(devOptionItemPrefab, contentParent);
puckForce.Setup("Puck Force", 2500, 6000, GameManager.instance.puckForce);
puckForce.OnChanged += OnPuckForceChanged;
DevOptionItem puckDragClampMax = Instantiate(devOptionItemPrefab, contentParent);
puckDragClampMax.Setup("Puck Launch Max Length", 1, 10, GameManager.instance.puckDragClampMax);
puckDragClampMax.OnChanged += OnPuckDragClampMaxChanged;
DevOptionItem puckDragClampMin = Instantiate(devOptionItemPrefab, contentParent);
puckDragClampMin.Setup("Puck Launch Min Length", 0, 2, GameManager.instance.puckDragMinClamp);
puckDragClampMin.OnChanged += OnPuckDragClampMinChanged;
DevOptionItem ballMoveTime = Instantiate(devOptionItemPrefab, contentParent);
ballMoveTime.Setup("Ball Drag", 0f, 10, GameManager.instance.ballMoveTime);
ballMoveTime.OnChanged += OnBallMoveTimeChanged;
DevOptionItem puckMass = Instantiate(devOptionItemPrefab, contentParent);
puckMass.Setup("Puck Mass", 1f, 50, GameManager.instance.puckMass);
puckMass.OnChanged += OnPuckMassChanged;
DevOptionItem puckDrag = Instantiate(devOptionItemPrefab, contentParent);
puckDrag.Setup("Puck Drag", 0f, 10, GameManager.instance.puckDrag);
puckDrag.OnChanged += OnPuckDragChanged;
}
void OnPuckForceChanged(float value)
{
GameManager.instance.puckForce = value;
OnChanged?.Invoke();
}
void OnPuckDragClampMaxChanged(float value)
{
GameManager.instance.puckDragClampMax = value;
OnChanged?.Invoke();
}
void OnPuckDragClampMinChanged(float value)
{
GameManager.instance.puckDragMinClamp = value;
OnChanged?.Invoke();
}
void OnBallMoveTimeChanged(float value)
{
GameManager.instance.ballMoveTime = value;
OnChanged?.Invoke();
}
void OnPuckMassChanged(float value)
{
GameManager.instance.puckMass = value;
OnChanged?.Invoke();
}
void OnPuckDragChanged(float value)
{
GameManager.instance.puckDrag = value;
OnChanged?.Invoke();
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 42df6f977bdfdf54092d0442ed988ef0

View File

@@ -44,6 +44,26 @@ public class GameManager : MonoBehaviour
public int hitCounter = 0;
public static GameManager instance;
public float puckMass{
get{
if(pucks.Count > 0){return pucks[0].rb.mass;}else{return 1f;}
}set{
foreach(Puck puck in pucks){
puck.rb.mass = value;
}
}
}
public float puckDrag{
get{
if(pucks.Count > 0){return pucks[0].rb.linearDamping;}else{return 0f;}
}set{
foreach(Puck puck in pucks){
puck.rb.linearDamping = value;
}
}
}
void Awake()
{
instance = this;
@@ -193,6 +213,8 @@ public class GameManager : MonoBehaviour
//kickoff goal
Debug.Log("Kickoff goal");
StartCoroutine(CoroutineOnGoal(team,true));//true = Kickoff goal, reset only the ball
hitCounter = 0;
return;
}
if(team == Team.Blue){
@@ -253,7 +275,7 @@ public class GameManager : MonoBehaviour
float resetDuration = 0.5f;
if(!kickoff){
foreach(Puck puck in pucks){
puck.Reset(resetDuration);
puck.Reset(null, resetDuration);
}
}

View File

@@ -14,7 +14,7 @@ public class Goal : MonoBehaviour
Debug.Log("Puck goal", gameObject);
Puck puck = collision.gameObject.GetComponent<Puck>();
Debug.Log(puck.name);
puck.ScheduleReset();
puck.ScheduleReset(collision.transform.position);
}
}

View File

@@ -101,13 +101,14 @@ public class Puck : MonoBehaviour
}
public void Reset(float duration)
public void Reset(Vector3? position = null, float duration = 0.5f)
{
StartCoroutine(CoroutineReset(duration));
Vector3 pos = position ?? startPosition;
StartCoroutine(CoroutineReset(pos, duration));
}
Coroutine coroutineScheduleReset;
public void ScheduleReset(float duration = 0.5f){
coroutineScheduleReset = StartCoroutine(CoroutineScheduleReset(duration));
public void ScheduleReset(Vector3 position, float duration = 0.5f){
coroutineScheduleReset = StartCoroutine(CoroutineScheduleReset(position, duration));
}
public void UnscheduleReset(){
@@ -116,20 +117,25 @@ public class Puck : MonoBehaviour
}
}
IEnumerator CoroutineScheduleReset(float duration){
IEnumerator CoroutineScheduleReset(Vector3 position, float duration){
while(GameManager.isMoving){
yield return null;
}
Reset(duration);
Debug.Log("Resetting puck", gameObject);
Vector3 dir = position - transform.position;
dir = dir.normalized;
position += dir * 1.25f;
Reset(position, duration);
}
IEnumerator CoroutineReset(float duration){
IEnumerator CoroutineReset(Vector3 pos, float duration){
float t=0;
Vector3 pos1 = transform.position;
Quaternion rot1 = transform.rotation;
while(t<duration){
t+=Time.deltaTime;
transform.position = Vector3.Lerp(pos1, startPosition, t/duration);
transform.position = Vector3.Lerp(pos1, pos, t/duration);
transform.rotation = Quaternion.Lerp(rot1, Quaternion.identity, t/duration);
yield return null;
}

View File

@@ -387,6 +387,66 @@ MonoBehaviour:
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 51
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -1.5537109
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 3
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 51
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -11.0859375
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 15
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 51
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -11.0859375
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 17
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 51
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -6.3828125
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 36
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 55
m_GlyphValueRecord:
@@ -657,6 +717,81 @@ MonoBehaviour:
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 85
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -4.745117
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 15
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 85
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -4.745117
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 17
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 85
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 3.1914062
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 2020
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 89
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -6.3828125
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 15
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 89
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: -6.3828125
m_YAdvance: 0
m_SecondAdjustmentRecord:
m_GlyphIndex: 17
m_GlyphValueRecord:
m_XPlacement: 0
m_YPlacement: 0
m_XAdvance: 0
m_YAdvance: 0
m_FeatureLookupFlags: 0
- m_FirstAdjustmentRecord:
m_GlyphIndex: 90
m_GlyphValueRecord: