示例#1
0
        private void Awake()
        {
            transformer = new Transformer(transform);

            levelSerializer = GetComponent <ILevelSerializer>();
            if (levelSerializer == null)
            {
                levelSerializer = gameObject.AddComponent <NullRoomSerializer>();
            }

            foreach (IsoMonoBehaviour isoMonoBehaviour in GetComponents <IsoMonoBehaviour>())
            {
                isoMonoBehaviour.OnInit(this);
            }

            if (loadOnStart)
            {
                LoadLevel();
            }

            floorObserver = GetComponent <FloorObserver>();
            wallObserver  = GetComponent <WallObserver>();
            itemObserver  = GetComponent <ItemObserver>();
        }
示例#2
0
 public void RegisterFloorObserver(FloorObserver observer)
 {
     floorObservers.Add(observer);
 }