Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- public class PlaceDoor : MonoBehaviour
- {
- Room _room;
- public enum DOOR_TYPES
- {
- OPEN_DOOR = 0,
- CLOSED_DOOR = 1,
- LOCKED_DOOR = 2
- }
- [SerializeField]
- private DOOR_TYPES _roomType;
- [SerializeField]
- private Sprite _openDoor;
- private int AmountTypes = 0;
- void Start()
- {
- _room = GetComponent<Room>();
- Doors();
- }
- void Doors()
- {
- switch (AmountTypes)
- {
- case 0:
- Debug.Log("OpenDoor");
- SpawnDoor(_openDoor,new Vector2(this.transform.position.x /2,0));
- break;
- case 1:
- Debug.Log("Close");
- break;
- case 2:
- Debug.Log("locked");
- break;
- default:
- Debug.Log("no doors");
- break;
- }
- }
- void SpawnDoor(Sprite sprite, Vector2 Location)
- {
- Instantiate(sprite, Location, Quaternion.identity);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement