Newer
Older
HardPoint-Project-Abertay-University-Unity3D / Assets / Scripts / Systems / RandomGeneration / RoomEntity.cs
@Rackday Rackday on 18 Aug 860 bytes Project Added
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RoomEntity : MonoBehaviour
{
    [HideInInspector]
    public ProgressController pc;
    [HideInInspector]
    public PlatformController platformController;
    [SerializeField]
    private bool contributesToProgress;
    private bool contributed = false;

    private void Start()
    {
        pc = transform.parent.GetComponent<ProgressController>();
        if(contributesToProgress)
        IncreaseTotalProgress();
    }
    public void IncreaseTotalProgress()
    {
        pc.AddToUpdatables(gameObject);
        pc.totalProgress += 1;
        
    }
    public void UpdateRoomInfo()
    {
        if(pc != null && !contributed)
        {
            if(contributesToProgress)
            pc.UpdateProgress();
            contributed= true;
        }
    }
}