Beispiel #1
0
        public EntrapmentStatus(GameObject victim)
        {
            Victim = victim ?? throw new ArgumentNullException("victim");
            var trapQuery = ClaustrophobiaChecker.CheckEntrapment(victim);

            if (trapQuery != null)
            {
                ReachableCells = trapQuery.ReachableCells;
                CanReachBed    = trapQuery.CanReachBed;
                CanReachMess   = trapQuery.CanReachMess;
                CanReachToilet = trapQuery.CanReachToilet;
            }
            else
            {
                ReachableCells = 0;
                CanReachBed    = false;
                CanReachMess   = false;
                CanReachToilet = false;
            }
            LastStatus  = EntrapmentState.None;
            StillLiving = true;
            VictimName  = victim.name;
        }
 protected override void OnPrefabInit()
 {
     base.OnPrefabInit();
     Instance = this;
 }
 protected override void OnCleanUp()
 {
     Instance = null;
     base.OnCleanUp();
 }