浏览代码

Refactored code to remove some warnings

/main
Ciro Continisio 3 年前
当前提交
53bc6c38
共有 10 个文件被更改,包括 52 次插入128 次删除
  1. 12
      UOP1_Project/Assets/AddressableAssetsData/AddressableAssetSettings.asset
  2. 15
      UOP1_Project/Assets/Scripts/Characters/Damageable.cs
  3. 24
      UOP1_Project/Assets/Scripts/Quests/Editor/LocalizationUtils.cs
  4. 12
      UOP1_Project/Assets/Scripts/Quests/StepController.cs
  5. 2
      UOP1_Project/Assets/Scripts/SaveSystem/FileManager.cs
  6. 10
      UOP1_Project/Assets/Scripts/StateMachine/Editor/TransitionTableEditorWindow.cs
  7. 55
      UOP1_Project/Assets/Scripts/UI/Settings/UISettingFieldsFiller.cs
  8. 36
      UOP1_Project/Assets/Scripts/UI/UIHealthBarManager.cs
  9. 6
      UOP1_Project/Assets/Shaders/Unused/ScriptableRenderFeatures/DepthNormalsFeature.cs
  10. 8
      UOP1_Project/Assets/Scenes/Locations/_EmptyLocation.meta

12
UOP1_Project/Assets/AddressableAssetsData/AddressableAssetSettings.asset


m_NonRecursiveBuilding: 0
m_maxConcurrentWebRequests: 500
m_ContiguousBundles: 0
m_StripUnityVersionFromBundleBuild: 0
m_DisableVisibleSubAssetRepresentations: 0
m_ShaderBundleNaming: 0
m_ShaderBundleCustomNaming:
m_MonoScriptBundleNaming: 0

m_GroupAssets:
- {fileID: 11400000, guid: c257cd646c09b42b8b86848b31864603, type: 2}
- {fileID: 11400000, guid: 687f8568fdfe9486e90431baad275de8, type: 2}
- {fileID: 11400000, guid: 55edbf66eaced4772a00c784ee3ff29c, type: 2}
- {fileID: 11400000, guid: 93a5cdac5b0a347009a72be0430f7b1f, type: 2}
- {fileID: 11400000, guid: c1b90ebf1519148689c99ed4fd5c6f44, type: 2}
- {fileID: 11400000, guid: 1b5698d56f32d4f1792faa2c959e3f33, type: 2}
- {fileID: 11400000, guid: 29f1ccd1d37d59a4abf84e61a41fb9d5, type: 2}
- {fileID: 11400000, guid: 88c964a48d7587e46bf53b80ee93f79b, type: 2}
- {fileID: 11400000, guid: 17f17930eab62fe419ac32652eab78fc, type: 2}
- {fileID: 11400000, guid: c909c8a405eee97478b5ec3c1f2582c2, type: 2}

- {fileID: 11400000, guid: c6089159bfe469d46ad3b0e68fe4aa09, type: 2}
- {fileID: 11400000, guid: f72ae0cfa384fd94f97ae062deb133b4, type: 2}
- {fileID: 11400000, guid: add118feb5e386044bb8b8315923472a, type: 2}
- {fileID: 11400000, guid: 55edbf66eaced4772a00c784ee3ff29c, type: 2}
- {fileID: 11400000, guid: 93a5cdac5b0a347009a72be0430f7b1f, type: 2}
- {fileID: 11400000, guid: c1b90ebf1519148689c99ed4fd5c6f44, type: 2}
- {fileID: 11400000, guid: 1b5698d56f32d4f1792faa2c959e3f33, type: 2}
- {fileID: 11400000, guid: edde951e863b54c09a38487e72fa7ca1, type: 2}
- {fileID: 11400000, guid: ca2d3d70ffeba45de9d06be7fd67a18e, type: 2}
- {fileID: 11400000, guid: cf8375b21d8ec437cb77dfbcdacac570, type: 2}

- {fileID: 11400000, guid: fcf8490568b5a0b47a7fe58d1033bfc3, type: 2}
- {fileID: 11400000, guid: cecd62da149d34d45938fce625af29a6, type: 2}
- {fileID: 11400000, guid: 38ec9971d12cc7f408261900bfc57b00, type: 2}
- {fileID: 11400000, guid: 29f1ccd1d37d59a4abf84e61a41fb9d5, type: 2}
m_BuildSettings:
m_CompileScriptsInVirtualMode: 0
m_CleanupStreamingAssetsAfterBuilds: 1

15
UOP1_Project/Assets/Scripts/Characters/Damageable.cs


[Header("Broadcasting On")]
[SerializeField] private IntEventChannelSO _setHealthBar = default;
public DroppableRewardConfigSO DroppableRewardConfig => _droppableRewardSO;
public DroppableRewardConfigSO DroppableRewardConfig => _droppableRewardSO;
public bool GetHit { get; set; }
public bool IsDead { get; set; }

public UnityAction OnDie;
private void Awake()

_updateHealthEvent.RaiseEvent();
}
public void Kill()
{
ReceiveAnAttack(_currentHealthSO.CurrentHealth);

if (_updateHealthEvent != null)
{
_updateHealthEvent.RaiseEvent();
}
}
if (_currentHealthSO.CurrentHealth <= 0)
{
IsDead = true;

}
IsDead = false;
}
public void restoreHealth(int healthToAdd)
{
if (IsDead)

24
UOP1_Project/Assets/Scripts/Quests/Editor/LocalizationUtils.cs


using System;
using UnityEngine.Localization;
using UnityEngine.Localization.Tables;
using UnityEngine.Localization.Tables;
{
{
#if UNITY_EDITOR
/// <summary>

}
#endif
{
// If we are in the editor in edit mode, we need to find a valid locale and get the localized string from it:
{
// If we are in the editor in edit mode, we need to find a valid locale and get the localized string from it:
return String.Empty;
return string.Empty;
string text = null;
if (!localizedStringReference.IsEmpty)

}
}
return text;
#endif
// At runtime (build or editor in play mode), we just get the localized string normally:
#else
// At runtime (build or editor in play mode), we just get the localized string normally:
#endif
}
}

12
UOP1_Project/Assets/Scripts/Quests/StepController.cs


[SerializeField] private ActorSO _actor = default;
[SerializeField] private DialogueDataSO _defaultDialogue = default;
[SerializeField] private QuestManagerSO _questData = default;
[SerializeField]
private GameStateSO _gameStateManager = default;
[SerializeField] private GameStateSO _gameStateManager = default;
[SerializeField] private DialogueActorChannelSO _interactionEvent = default;
//[SerializeField]
public IntEventChannelSO _endDialogueEvent = default;
[SerializeField] private IntEventChannelSO _endDialogueEvent = default;
//[SerializeField]
public DialogueDataChannelSO _startDialogueEvent = default;
[Header("Dialogue Shot Camera")]

}
//start a dialogue when interaction
//some Steps need to be instantanious. And do not need the interact button.
//when interaction again, restart same dialogue.

}
void StartDialogue()
{
_startDialogueEvent.RaiseEvent(_currentDialogue);

if (dialogueShot)
dialogueShot.SetActive(true);
}
void EndDialogue(int dialogueType)
{
_endDialogueEvent.OnEventRaised -= EndDialogue;

2
UOP1_Project/Assets/Scripts/SaveSystem/FileManager.cs


}
catch (Exception e)
{
//Debug.LogError($"Failed to move file from {fullPath} to {newFullPath} with exception {e}");
Debug.LogError($"Failed to move file from {fullPath} to {newFullPath} with exception {e}");
return false;
}

10
UOP1_Project/Assets/Scripts/StateMachine/Editor/TransitionTableEditorWindow.cs


private void OnLostFocus()
{
ListView listView = rootVisualElement.Q<ListView>(className: "table-list");
listView.onSelectionChanged -= OnListSelectionChanged;
listView.onSelectionChange -= OnListSelectionChanged;
}
private void Update()

listView.bindItem = (element, i) => ((Label)element).text = assets[i].name;
listView.selectionType = SelectionType.Single;
listView.onSelectionChanged -= OnListSelectionChanged;
listView.onSelectionChanged += OnListSelectionChanged;
listView.onSelectionChange -= OnListSelectionChanged;
listView.onSelectionChange += OnListSelectionChanged;
private void OnListSelectionChanged(List<object> list)
private void OnListSelectionChanged(IEnumerable<object> enumerable)
List<object> list = (List<object>)enumerable;
if (list.Count == 0)
return;

55
UOP1_Project/Assets/Scripts/UI/Settings/UISettingFieldsFiller.cs


public class UISettingFieldsFiller : MonoBehaviour
{
[SerializeField]
private UISettingItemFiller[] _settingfieldsList = default;
[SerializeField]
private InputReader _inputReader = default;
[SerializeField] private UISettingItemFiller[] _settingfieldsList = default;
public void FillFields(List<SettingField> settingItems)
{
for (int i = 0; i < _settingfieldsList.Length; i++)

}
}
public void SetField(SettingField field, UISettingItemFiller uiField)
{

}
string GetQualityLevelTitle()
{
string title = "";
switch (QualitySettings.GetQualityLevel())
{
case (int)QualityLevel.Beautiful:
title = QualityLevel.Beautiful.ToString();
break;
case (int)QualityLevel.Fantastic:
title = QualityLevel.Fantastic.ToString();
break;
case (int)QualityLevel.Fast:
title = QualityLevel.Fast.ToString();
break;
case (int)QualityLevel.Fastest:
title = QualityLevel.Fastest.ToString();
break;
case (int)QualityLevel.Good:
title = QualityLevel.Good.ToString();
break;
case (int)QualityLevel.Simple:
title = QualityLevel.Simple.ToString();
break;
}
return title;
}
int IsFullscreen()
{
if (Screen.fullScreen)

{
return 1;
}
}
int _selectedFieldIndex;
void NextField()
{
}
void PreviousField()
{
}
}

36
UOP1_Project/Assets/Scripts/UI/UIHealthBarManager.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using TMPro;
[SerializeField]
private HealthSO _currentHealth = default;
[SerializeField]
private HealthConfigSO _healthConfig = default;
[SerializeField] private HealthSO _currentHealth = default;
[SerializeField] private HealthConfigSO _healthConfig = default;
[SerializeField] private TextMeshProUGUI healthText = default;
[SerializeField] private VoidEventChannelSO _updateHealthEvent = default;
private void OnEnable()

private void Start()
{
}
public void SetHealthBar()
{
_currentHealth.SetMaxHealth(_healthConfig.MaxHealth);

int heartValue = _currentHealth.MaxHealth / _heartImages.Length;
int filledHeartCount = Mathf.FloorToInt((float)_currentHealth.CurrentHealth / heartValue);

heartPercent = 0;
}
_heartImages[i].SetImage(heartPercent);
}

6
UOP1_Project/Assets/Shaders/Unused/ScriptableRenderFeatures/DepthNormalsFeature.cs


drawSettings.perObjectData = PerObjectData.None;
ref CameraData cameraData = ref renderingData.cameraData;
Camera camera = cameraData.camera;
if (cameraData.isStereoEnabled)
context.StartMultiEye(camera);
drawSettings.overrideMaterial = depthNormalsMaterial;

8
UOP1_Project/Assets/Scenes/Locations/_EmptyLocation.meta


fileFormatVersion: 2
guid: 79bc22bf39a26cd4aadde13777241568
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存