Jump to content

Unity Camera CUT


Recommended Posts

Najlepiej stworzyc pare kamer i kontrolowac ich depth - poniewaz tak ladnie podziekowales znowu lapaj scene :)

CameraCUT.zip

 

Na Main Camera masz scrypcik w ktorym tworzysz tablice kamer oraz tablice delayow przeskoku miedzy nimi - zobacz jak to jest zrobione w scenie.

 

EDIT:

Daje tez caly kod tego skryptu:

using UnityEngine;
using System.Collections;

public class CameraCUT : MonoBehaviour 
{
   public Camera[] cameras;
   public float[] delays;

   private int _currentID = 0;

   void Start () 
   {
       cameras[_currentID].depth = 100;
       cameras[_currentID + 1].depth = -100;
       StartCoroutine ( "nextCamera", delays[_currentID] );
   }

   private IEnumerator nextCamera ( float delay )
   {
       if ( _currentID + 1         {
           yield return new WaitForSeconds ( delay );
           cameras[_currentID].depth = -100;
           _currentID++;
           cameras[_currentID].depth = 100;
           StartCoroutine ( "nextCamera", delays[_currentID] );
       }
   }
}

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We are using cookies. Read about our Privacy Policy