Пример #1
0
    void SetCameraBehaviour(CameraBehaviour behaviour)
    {
        //if the current behaviour is equal to the passed in behaviour then return
        if (m_CurrentBehaviour == behaviour)
        {
            return;
        }

        //if the current behaviour isn't null
        if (m_CurrentBehaviour != null)
        {
            //call the deactivate method of the newly set behaviour
            m_CurrentBehaviour.Deactivate();
        }

        //set the current behaviour to the behaviour passed in
        m_CurrentBehaviour = behaviour;

        if (m_CurrentBehaviour != null)
        {
            //call the activate method of the newly set behaviour
            m_CurrentBehaviour.Activate();
        }
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     cam.Player1 = player1;
     cam.Player2 = player2;
     cam.Activate(true);
 }