ux
This commit is contained in:
parent
20822f1e58
commit
57c99b681a
11 changed files with 80747 additions and 79195 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -61,6 +61,7 @@ MonoBehaviour:
|
|||
connected: []
|
||||
hovered: 0
|
||||
Nachos: 0
|
||||
ExpectedUnitDiff: 0
|
||||
--- !u!33 &2275744724860474492
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -147,6 +148,14 @@ PrefabInstance:
|
|||
propertyPath: m_Name
|
||||
value: Text (TMP)
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6055350264736109491, guid: 5d12260eabac775499459852270e99c8, type: 3}
|
||||
propertyPath: m_text
|
||||
value: '0 '
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6055350264736109491, guid: 5d12260eabac775499459852270e99c8, type: 3}
|
||||
propertyPath: m_enableVertexGradient
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6566716362904575638, guid: 5d12260eabac775499459852270e99c8, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ public class GameManager : MonoBehaviour
|
|||
public int nodeToId;
|
||||
public int amount;
|
||||
public int player;
|
||||
public int tempDaniel;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
|
@ -160,7 +161,9 @@ public class GameManager : MonoBehaviour
|
|||
|
||||
private void Start()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
LoadLevelData(selectedLevel);
|
||||
#endif
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
|
@ -373,6 +376,15 @@ public class GameManager : MonoBehaviour
|
|||
{
|
||||
Destroy(actionListParent.GetChild(i).gameObject);
|
||||
}
|
||||
actions.ForEach(action =>
|
||||
{
|
||||
var to = GetNodes().Where(n => n.id == action.nodeToId).First();
|
||||
var from = GetNodes().Where(n => n.id == action.nodeFromId).First();
|
||||
|
||||
to.ExpectedUnitDiff = 0;
|
||||
from.ExpectedUnitDiff = 0;
|
||||
});
|
||||
|
||||
|
||||
actions.Clear();
|
||||
|
||||
|
|
@ -407,8 +419,63 @@ public class GameManager : MonoBehaviour
|
|||
ui.GetComponentInChildren<TMP_Text>().text = ActionTypeText[action.intendedAction] + " (" + action.nodeFromId + ">" + action.nodeToId + ")";
|
||||
ui.GetComponentInChildren<Button>().onClick.AddListener(() => {
|
||||
actions.Remove(action);
|
||||
var to = GetNodes().Where(n => n.id == action.nodeToId).First();
|
||||
var from = GetNodes().Where(n => n.id == action.nodeFromId).First();
|
||||
|
||||
switch (action.intendedAction)
|
||||
{
|
||||
case ActionType.MOVE_HALF_UNITS:
|
||||
from.ExpectedUnitDiff += action.tempDaniel;
|
||||
to.ExpectedUnitDiff -= action.tempDaniel;
|
||||
break;
|
||||
case ActionType.MOVE_ALL_UNITS:
|
||||
from.ExpectedUnitDiff += action.tempDaniel;
|
||||
to.ExpectedUnitDiff -= action.tempDaniel;
|
||||
break;
|
||||
case ActionType.ATTACK_NODE_WITH_HALF:
|
||||
case ActionType.ATTACK_CON_WITH_HALF:
|
||||
from.ExpectedUnitDiff += action.tempDaniel;
|
||||
to.ExpectedUnitDiff += action.tempDaniel;
|
||||
break;
|
||||
case ActionType.ATTACK_NODE_WITH_ALL:
|
||||
case ActionType.ATTACK_CON_WITH_ALL:
|
||||
from.ExpectedUnitDiff += action.tempDaniel;
|
||||
to.ExpectedUnitDiff += action.tempDaniel;
|
||||
break;
|
||||
}
|
||||
|
||||
Destroy(ui);
|
||||
});
|
||||
|
||||
var from = GetNodes().Where(n => n.id == action.nodeFromId).First();
|
||||
var to = GetNodes().Where(n => n.id == action.nodeToId).First();
|
||||
|
||||
// TODO: Alle diffs durchgehen nach jedem break
|
||||
switch (action.intendedAction)
|
||||
{
|
||||
case ActionType.MOVE_HALF_UNITS:
|
||||
to.ExpectedUnitDiff += (from.Units + from.ExpectedUnitDiff) / 2;
|
||||
action.tempDaniel += (from.Units + from.ExpectedUnitDiff) / 2;
|
||||
from.ExpectedUnitDiff -= (from.Units + from.ExpectedUnitDiff) / 2;
|
||||
break;
|
||||
case ActionType.MOVE_ALL_UNITS:
|
||||
to.ExpectedUnitDiff += (from.Units+ from.ExpectedUnitDiff) ;
|
||||
action.tempDaniel += (from.Units+ from.ExpectedUnitDiff) ;
|
||||
from.ExpectedUnitDiff -= (from.Units+ from.ExpectedUnitDiff) ;
|
||||
break;
|
||||
case ActionType.ATTACK_NODE_WITH_HALF:
|
||||
case ActionType.ATTACK_CON_WITH_HALF:
|
||||
to.ExpectedUnitDiff -= (from.Units + from.ExpectedUnitDiff) / 2;
|
||||
action.tempDaniel += (from.Units + from.ExpectedUnitDiff) / 2;
|
||||
from.ExpectedUnitDiff -= (from.Units + from.ExpectedUnitDiff) / 2;
|
||||
break;
|
||||
case ActionType.ATTACK_NODE_WITH_ALL:
|
||||
case ActionType.ATTACK_CON_WITH_ALL:
|
||||
to.ExpectedUnitDiff -= (from.Units+ from.ExpectedUnitDiff) ;
|
||||
action.tempDaniel += (from.Units+ from.ExpectedUnitDiff) ;
|
||||
from.ExpectedUnitDiff -= (from.Units+ from.ExpectedUnitDiff) ;
|
||||
break;
|
||||
}
|
||||
actions.Add(action);
|
||||
}
|
||||
public Action PushNewAction(int nodeFromId, int nodeToId, bool onConnection = false, int? player = null, bool ? altAction = null)
|
||||
|
|
@ -497,13 +564,13 @@ public class GameManager : MonoBehaviour
|
|||
nodeTo.Units -= attackers;
|
||||
nodeFrom.Units -= attackers;
|
||||
|
||||
if (nodeTo.Units <= 0)
|
||||
if (nodeTo.Units < 0)
|
||||
{
|
||||
nodeTo.Owner = currentPlayer;
|
||||
nodeTo.Units = Math.Abs(nodeTo.Units);
|
||||
}
|
||||
} else
|
||||
|
||||
if (nodeFrom.Units <= 0)
|
||||
if (nodeFrom.Units == 0)
|
||||
{
|
||||
nodeFrom.Owner = -1;
|
||||
nodeFrom.Units = 0;
|
||||
|
|
@ -518,13 +585,13 @@ public class GameManager : MonoBehaviour
|
|||
nodeTo.Units -= attackers;
|
||||
nodeFrom.Units -= attackers;
|
||||
|
||||
if (nodeTo.Units <= 0)
|
||||
if (nodeTo.Units < 0)
|
||||
{
|
||||
nodeTo.Owner = nodeTo.Units == 0 ? -1 : currentPlayer;
|
||||
nodeTo.Units = Math.Abs(nodeTo.Units);
|
||||
}
|
||||
} else
|
||||
|
||||
if (nodeFrom.Units <= 0)
|
||||
if (nodeFrom.Units == 0)
|
||||
{
|
||||
nodeFrom.Owner = -1;
|
||||
nodeFrom.Units = 0;
|
||||
|
|
@ -588,6 +655,7 @@ public class GameManager : MonoBehaviour
|
|||
break;
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
public void GenerateAlongSphere()
|
||||
{
|
||||
for (int i = NodeParent.childCount - 1; i >= 0; i--)
|
||||
|
|
@ -743,4 +811,5 @@ public class GameManager : MonoBehaviour
|
|||
int newIndex = index < 0 ? levels.Count - 1 : index;
|
||||
selectedLevel = newIndex;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -21,6 +21,8 @@ public class Node : MonoBehaviour
|
|||
|
||||
public int Nachos = 0;
|
||||
|
||||
public int ExpectedUnitDiff = 0;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
UpdateColor();
|
||||
|
|
@ -46,7 +48,8 @@ public class Node : MonoBehaviour
|
|||
void Update()
|
||||
{
|
||||
unitText.enabled = hovered;
|
||||
unitText.text = Units.ToString();
|
||||
unitText.text = $"{Units} {(ExpectedUnitDiff != 0 ? $"({ExpectedUnitDiff})" : "")} ";
|
||||
|
||||
unitText.transform.forward = Camera.main.transform.forward;
|
||||
UpdateColor();
|
||||
UpdateTransform();
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ MonoBehaviour:
|
|||
m_UseAdaptivePerformance: 1
|
||||
m_ColorGradingMode: 0
|
||||
m_ColorGradingLutSize: 32
|
||||
m_AllowPostProcessAlphaOutput: 0
|
||||
m_UseFastSRGBLinearConversion: 0
|
||||
m_SupportDataDrivenLensFlare: 1
|
||||
m_SupportScreenSpaceLensFlare: 1
|
||||
m_GPUResidentDrawerMode: 0
|
||||
m_UseLegacyLightmaps: 0
|
||||
m_SmallMeshScreenPercentage: 0
|
||||
m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0
|
||||
m_ShadowType: 1
|
||||
|
|
@ -100,15 +100,16 @@ MonoBehaviour:
|
|||
m_Keys: []
|
||||
m_Values:
|
||||
m_PrefilteringModeMainLightShadows: 3
|
||||
m_PrefilteringModeAdditionalLight: 4
|
||||
m_PrefilteringModeAdditionalLightShadows: 0
|
||||
m_PrefilteringModeAdditionalLight: 0
|
||||
m_PrefilteringModeAdditionalLightShadows: 2
|
||||
m_PrefilterXRKeywords: 1
|
||||
m_PrefilteringModeForwardPlus: 1
|
||||
m_PrefilteringModeForwardPlus: 2
|
||||
m_PrefilteringModeDeferredRendering: 0
|
||||
m_PrefilteringModeScreenSpaceOcclusion: 1
|
||||
m_PrefilteringModeScreenSpaceOcclusion: 2
|
||||
m_PrefilterDebugKeywords: 1
|
||||
m_PrefilterWriteRenderingLayers: 0
|
||||
m_PrefilterWriteRenderingLayers: 1
|
||||
m_PrefilterHDROutput: 1
|
||||
m_PrefilterAlphaOutput: 1
|
||||
m_PrefilterSSAODepthNormals: 0
|
||||
m_PrefilterSSAOSourceDepthLow: 1
|
||||
m_PrefilterSSAOSourceDepthMedium: 1
|
||||
|
|
@ -120,10 +121,10 @@ MonoBehaviour:
|
|||
m_PrefilterSSAOSampleCountHigh: 1
|
||||
m_PrefilterDBufferMRT1: 1
|
||||
m_PrefilterDBufferMRT2: 1
|
||||
m_PrefilterDBufferMRT3: 0
|
||||
m_PrefilterSoftShadowsQualityLow: 0
|
||||
m_PrefilterSoftShadowsQualityMedium: 0
|
||||
m_PrefilterSoftShadowsQualityHigh: 0
|
||||
m_PrefilterDBufferMRT3: 1
|
||||
m_PrefilterSoftShadowsQualityLow: 1
|
||||
m_PrefilterSoftShadowsQualityMedium: 1
|
||||
m_PrefilterSoftShadowsQualityHigh: 1
|
||||
m_PrefilterSoftShadows: 0
|
||||
m_PrefilterScreenCoord: 1
|
||||
m_PrefilterNativeRenderPass: 1
|
||||
|
|
|
|||
|
|
@ -55,7 +55,17 @@ MonoBehaviour:
|
|||
- rid: 8712630790384254976
|
||||
- rid: 3482916744682799104
|
||||
m_RuntimeSettings:
|
||||
m_List: []
|
||||
m_List:
|
||||
- rid: 6852985685364965378
|
||||
- rid: 6852985685364965379
|
||||
- rid: 6852985685364965380
|
||||
- rid: 6852985685364965381
|
||||
- rid: 6852985685364965384
|
||||
- rid: 6852985685364965385
|
||||
- rid: 6852985685364965392
|
||||
- rid: 6852985685364965394
|
||||
- rid: 8712630790384254976
|
||||
- rid: 3482916744682799104
|
||||
m_AssetVersion: 8
|
||||
m_ObsoleteDefaultVolumeProfile: {fileID: 0}
|
||||
m_RenderingLayerNames:
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
BIN
Build.zip
Normal file
BIN
Build.zip
Normal file
Binary file not shown.
|
|
@ -5,9 +5,12 @@ EditorBuildSettings:
|
|||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Scenes:
|
||||
- enabled: 1
|
||||
- enabled: 0
|
||||
path: Assets/Scenes/SampleScene.unity
|
||||
guid: 99c9720ab356a0642a771bea13969a05
|
||||
- enabled: 1
|
||||
path: Assets/Earth/EarthScene.unity
|
||||
guid: e3523ca6db1f20c458e410e2aba84ee8
|
||||
m_configObjects:
|
||||
com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
m_UseUCBPForAssetBundles: 0
|
||||
|
|
|
|||
|
|
@ -36,10 +36,8 @@ GraphicsSettings:
|
|||
- {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_PreloadedShaders: []
|
||||
m_PreloadShadersBatchTimeLimit: -1
|
||||
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
|
||||
type: 0}
|
||||
m_CustomRenderPipeline: {fileID: 11400000, guid: 4b83569d67af61e458304325a23e5dfd,
|
||||
type: 2}
|
||||
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_CustomRenderPipeline: {fileID: 11400000, guid: 4b83569d67af61e458304325a23e5dfd, type: 2}
|
||||
m_TransparencySortMode: 0
|
||||
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
|
||||
m_DefaultRenderingPath: 1
|
||||
|
|
@ -60,8 +58,7 @@ GraphicsSettings:
|
|||
m_FogKeepExp2: 1
|
||||
m_AlbedoSwatchInfos: []
|
||||
m_RenderPipelineGlobalSettingsMap:
|
||||
UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: 18dc0cd2c080841dea60987a38ce93fa,
|
||||
type: 2}
|
||||
UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: 18dc0cd2c080841dea60987a38ce93fa, type: 2}
|
||||
m_LightsUseLinearIntensity: 1
|
||||
m_LightsUseColorTemperature: 1
|
||||
m_LogWhenShaderIsCompiled: 0
|
||||
|
|
|
|||
|
|
@ -141,7 +141,8 @@ PlayerSettings:
|
|||
visionOSBundleVersion: 1.0
|
||||
tvOSBundleVersion: 1.0
|
||||
bundleVersion: 0.1.0
|
||||
preloadedAssets: []
|
||||
preloadedAssets:
|
||||
- {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3}
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue