WJ2GH73OS7Q2UW6EKB4KWR222XQRJHGZA3UI3BO7V5NM7ZRKF5WQC
fileFormatVersion: 2
guid: 7fe8464920cbc2f4fb1dccb492d5e0b1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 47518c843f5454846a5967890d1a997c, type: 3}
m_Name: TurnSystem
m_EditorClassIdentifier:
fileFormatVersion: 2
guid: 47518c843f5454846a5967890d1a997c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
[CreateAssetMenu(fileName = "Data", menuName = "ScriptableObjects/TurnSystem", order = 1)]
public class TurnSystem : ScriptableObject
{
private int turnNumber = 1;
public event EventHandler OnTurnChanged;
private bool isPlayerTurn = true;
public void EndTurn() {
turnNumber++;
isPlayerTurn = !isPlayerTurn;
OnTurnChanged?.Invoke(this, EventArgs.Empty);
}
public int GetTurnNumber() => turnNumber;
public bool IsPlayerTurn() => isPlayerTurn;
}