Exemplo n.º 1
0
 private void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(this.gameObject);
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Exemplo n.º 2
0
    // public GameObject doorClosed;
    // public GameObject doorOpened;
    //private Transform transform;
    void Start()
    {
        instance   = this;
        thePlayer  = FindObjectOfType <PlayerManager>();
        thisBox    = GetComponent <BoxCollider2D>();
        theUnknown = FindObjectOfType <UnknownScript>();
        //transform = GetComponent<Transform>();
        //this.gameObject.GetComponent<BoxCollider2D>().isTrigger = true;
        thisBox.isTrigger = true;
        theFade           = FadeManager.instance;
        theOrder          = OrderManager.instance;
        theDB             = DatabaseManager.instance;
        theDM             = DialogueManager.instance;
        theAudio          = AudioManager.instance;

        if (theDB.doorEnabledList.Contains(doorNum))//DB list에 있으면 문 열린 상태.
        {
            Enabled = true;
        }
        if (theDB.doorLockedList.Contains(doorNum))//DB lockedlist에 있으면 문 잠김.
        {
            locked = true;
        }

        if (dialogue_1 == null)
        {
            dialogue_1.names[0]     = "나";
            dialogue_1.sentences[0] = "아직 이곳을 잘 살펴보지 못했다.\n 아무것도 모른채로 다른 곳으로는 갈 수 없다.";
        }
        //if(!lockedDoor.GetComponent<TransferMap>().Enabled)
        //    locked = true;
        //else if(!theDB.doorList.Contains(doorNum)){
        //    Enabled = false;
        //theDB.doorList.Add(doorNum);
        //}

        if (!thePlayer.isChased)
        {
            onWaitingFlag = true;
        }

        if (MapManager.instance.ForceEnableDoors)
        {
            Enabled = true;
        }
    }
Exemplo n.º 3
0
    // public GameObject doorClosed;
    // public GameObject doorOpened;
    //private Transform transform;
    void Start()
    {
        //instance = this;
        thePlayer  = FindObjectOfType <PlayerManager>();
        thatBox    = goTo.GetComponent <BoxCollider2D>();
        theUnknown = FindObjectOfType <UnknownScript>();
        //transform = GetComponent<Transform>();
        //this.gameObject.GetComponent<BoxCollider2D>().isTrigger = true;
        thatBox.isTrigger = true;
        theFade           = FadeManager.instance;
        theOrder          = OrderManager.instance;
        theDB             = DatabaseManager.instance;
        theDM             = DialogueManager.instance;
        theAudio          = AudioManager.instance;
        theCamera         = CameraMovement.instance;

        //if(!thePlayer.isChased) onWaitingFlag =true;
    }
Exemplo n.º 4
0
    public string lastPoint;    //s



    void Start()
    {
        theCamera  = FindObjectOfType <CameraMovement>();
        thePlayer  = FindObjectOfType <PlayerManager>();
        theFade    = FindObjectOfType <FadeManager>();
        theOrder   = FindObjectOfType <OrderManager>();
        theUnknown = FindObjectOfType <UnknownScript>();
        this.gameObject.GetComponent <BoxCollider2D>().isTrigger = true;
        //theOrder.Move();
        if ((startPoint == thePlayer.currentMapName) && (lastPoint == thePlayer.lastMapName))//s
        {
            theCamera.transform.position = new Vector3(this.transform.position.x, this.transform.position.y, theCamera.transform.position.z);
            thePlayer.transform.position = this.transform.position;

            if (theUnknown != null)
            {
                theUnknown.startPoint = this.transform;
            }
            //theFade.FadeIn();
        }
    }