46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using UnityEditor;
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
using System;
|
|
|
|
[Serializable]
|
|
public class MissionStepModel
|
|
{
|
|
[SerializeField] // this flag tell whatewer dialoge ware already display to user
|
|
public MissionStepStatusEnum Status = MissionStepStatusEnum.None;
|
|
|
|
[SerializeField]
|
|
public DialogueStepModel DialogueStep;
|
|
|
|
[SerializeField]
|
|
public MissionReward Reward;
|
|
|
|
|
|
public MissionStepModel() { }
|
|
|
|
|
|
// Copied from DialogueStepModel
|
|
public virtual void Build()
|
|
{
|
|
DialogueStep.EndOfDialogueStepAction.AddListener(GiveReward);
|
|
|
|
DialogueStep.Build();
|
|
}
|
|
|
|
// Assign geting reward as Model End Action
|
|
public void GiveReward()
|
|
{
|
|
var Player = GameObject.FindGameObjectWithTag("Player");
|
|
|
|
if (!Player)
|
|
Debug.LogError("MissionStepModel::GetReward - There is no player on scene!!!");
|
|
|
|
Player.GetComponent<PlayerActions>().GetReward(Reward);
|
|
}
|
|
}
|
|
|
|
// TODO
|
|
// zapobieganie zniuknieciu itemow po otrzymaniu nagrody z poanelu gracza - WYKONANIE SAVE PO ZAKOŃCZENIU STEPU:
|
|
// -- zapisanie postępu misji w pliku z misjami
|
|
// -- zapisanie statusu panelu gracza (lista misji / content ekwipunku / magazynu) |