Esempio n. 1
0
    public IEnumerator MoveToRoom(StageEntryPoint point, Transform player)
    {
        //diable move
        var control = player.GetComponent <UnityChan2DController>();

        control.SetPlayerControl(false);
        //start fadein
        yield return(StartCoroutine(fadecanvas.DoFadeIn(1, 1)));

        //teleport player
        player.transform.position = point.m_inTransform.position;
        //set room camera confiner
        var confiner = point.GetComponentInParent <RoomPointHolder>().cameraBound;

        if (confiner)
        {
            cameraconfiner.m_BoundingShape2D = confiner;
        }

        //start fadeout
        yield return(StartCoroutine(fadecanvas.DoFadeIn(1, 0)));

        //enable move
        control.SetPlayerControl(true);
    }
Esempio n. 2
0
 // Update is called once per frame
 void Update()
 {
     if (entrypoint)
     {
         if (Input.GetKeyDown(KeyCode.Q))
         {
             entrypoint.Activate(this.transform);
             entrypoint  = entrypoint.myTargetPoint;
             currentroom = entrypoint.GetComponentInParent <RoomPointHolder>();
         }
     }
 }