浏览代码

[Bot] Automated dotnet-format update

/main
uChema 4 年前
当前提交
821d5ccf
共有 8 个文件被更改,包括 73 次插入73 次删除
  1. 20
      UOP1_Project/Assets/Scripts/Dialogues/DialogueDataSO.cs
  2. 4
      UOP1_Project/Assets/Scripts/Inventory/CollectibleItem.cs
  3. 14
      UOP1_Project/Assets/Scripts/Localization/LocalizeComponent_TMProFont.cs
  4. 4
      UOP1_Project/Assets/Scripts/Localization/LocalizeTMProFontEvent.cs
  5. 16
      UOP1_Project/Assets/Scripts/QuestManager.cs
  6. 34
      UOP1_Project/Assets/Scripts/Quests/QuestAncorSO.cs
  7. 52
      UOP1_Project/Assets/Scripts/Quests/StepController.cs
  8. 2
      UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs

20
UOP1_Project/Assets/Scripts/Dialogues/DialogueDataSO.cs


// Each line would also have an event associated, or another Dialogue
private void OnEnable()
{
// SetDialogueLines();
// SetDialogueLines();
}
void SetDialogueLines()
{

int index = 0;
LocalizedString _dialogueLine = null;
do
{
{
{
{
}
else
{
}
else
{
} while (_dialogueLine != null );
} while (_dialogueLine != null);
}
}
}

4
UOP1_Project/Assets/Scripts/Inventory/CollectibleItem.cs


[SerializeField] private Item _currentItem = default;
[SerializeField] private SpriteRenderer[] _itemImages = default;
[SerializeField] private SpriteRenderer[] _itemImages = default;
if(_itemImages!=null)
if (_itemImages != null)
SetItem();
}

14
UOP1_Project/Assets/Scripts/Localization/LocalizeComponent_TMProFont.cs


}
public static MonoBehaviour SetupForStringLocalization(TextMeshProUGUI target)
{
//Avoid adding the component multiple times
{
//Avoid adding the component multiple times
if (target.GetComponent<LocalizeStringEvent>() != null)
return null;

}
public static MonoBehaviour SetupForFontLocalization(TextMeshProUGUI target)
{
//Avoid adding the component multiple times
{
//Avoid adding the component multiple times
if (target.GetComponent<LocalizeTMProFontEvent>() != null)
return null;

Events.UnityEventTools.AddPersistentListener(comp.OnUpdateAsset, methodDelegate);
//Find font table and set it up automatically
Events.UnityEventTools.AddPersistentListener(comp.OnUpdateAsset, methodDelegate);
//Find font table and set it up automatically
var collections = LocalizationEditorSettings.GetAssetTableCollections();
foreach (var tableCollection in collections)
{

4
UOP1_Project/Assets/Scripts/Localization/LocalizeTMProFontEvent.cs


using UnityEngine.Events;
namespace UnityEngine.Localization.Components
{
{
/// <summary>
/// Component that can be used to Localize a TMP_FontAsset asset.
/// </summary>

}
[Serializable]
public class LocalizedTMProFont : LocalizedAsset<TMP_FontAsset>{ }
public class LocalizedTMProFont : LocalizedAsset<TMP_FontAsset> { }
[Serializable]
public class UnityEventFont : UnityEvent<TMP_FontAsset> { }

16
UOP1_Project/Assets/Scripts/QuestManager.cs


[SerializeField] private QuestAncorSO _questAnchor = default;
// Start is called before the first frame update
void Start()
{
_questAnchor.StartGame();
}
{
_questAnchor.StartGame();
}
// Update is called once per frame
void Update()
{
}
// Update is called once per frame
void Update()
{
}
}

34
UOP1_Project/Assets/Scripts/Quests/QuestAncorSO.cs


[SerializeField] private ItemEventChannelSO _giveItemEvent = default;
[SerializeField] private ItemEventChannelSO _rewardItemEvent = default;
private QuestSO _currentQuest=null;
private QuestSO _currentQuest = null;
public void StartGame()
public void StartGame()
{//Add code for saved information
if (_checkStepValidityEvent != null)
{

}
void StartQuestline()
{
if (_questlines != null)
if (_questlines != null)
{
if (_questlines.Exists(o => !o.IsDone))
{

}
bool hasStep(ActorSO actorToCheckWith)
{
if(_currentStep!=null)
if (_currentStep != null)
if(_currentStep.Actor== actorToCheckWith)
if (_currentStep.Actor == actorToCheckWith)
return true;
return true;
return false;
return false;
}
bool CheckQuestlineForQuestWithActor(ActorSO actorToCheckWith)

if (_currentQuestline != null)
{
return _currentQuestline.Quests.Exists(o => !o.IsDone && o.Steps != null && o.Steps[0].Actor == actorToCheckWith);
}

public DialogueDataSO InteractWithCharacter(ActorSO actor, bool isCheckValidity, bool isValid)
{
Debug.Log("current quest"+ _currentQuest);
Debug.Log("current quest" + _currentQuest);
if (_currentQuest == null)
{
if (CheckQuestlineForQuestWithActor(actor))

}
else
{
return _currentStep.DialogueBeforeStep;
return _currentStep.DialogueBeforeStep;
}
}

}
}
void CheckStepValidity()
void CheckStepValidity()
{
if (_currentStep != null)

case stepType.checkItem:
if (_inventory.Contains(_currentStep.Item))
{
_inventory.Contains(_currentStep.Item);

case stepType.rewardItem:
_rewardItemEvent.RaiseEvent(_currentStep.Item);
//no dialogue is needed after Reward Item
if(_currentStep.CompleteDialogue !=null)
if (_currentStep.CompleteDialogue != null)
{
_completeDialogueEvent.RaiseEvent();
}

}
void EndStep()
{
_currentStep = null;
if (_currentQuest != null)

}
else
{
{
EndQuest();
EndQuest();
}
}

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


private void Start()
{
if (_defaultDialogue != null)
{
_currentDialogue = _defaultDialogue;
StartDialogue();
}
if (_defaultDialogue != null)
{
_currentDialogue = _defaultDialogue;
StartDialogue();
}
DialogueDataSO displayDialogue =_questAnchor.InteractWithCharacter(_actor, false, false);
DialogueDataSO displayDialogue = _questAnchor.InteractWithCharacter(_actor, false, false);
if (displayDialogue !=null)
{
_currentDialogue = displayDialogue;
StartDialogue();
}
else
{
PlayDefaultDialogue();
}
if (displayDialogue != null)
{
_currentDialogue = displayDialogue;
StartDialogue();
}
else
{
PlayDefaultDialogue();
}
void StartDialogue()
{
if (_startDialogueEvent != null)

}
}
void PlayWinDialogue()

}
}
}

2
UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs


}
public void ButtonClicked()
{
{
if (_makeAChoiceEvent != null)
_makeAChoiceEvent.RaiseEvent(currentChoice);
}
正在加载...
取消
保存