Inheritance: MonoBehaviour
Esempio n. 1
0
    void Start()                                                                                                    //Use this for initialization
    {
        SplitScreenCamera ssC = GameObject.FindWithTag("GameManager").GetComponentInChildren <SplitScreenCamera>(); //Get the SplitScreenCamera once

        parrotCamera1 = ssC.ParrotCamera1;
        parrotCamera2 = ssC.ParrotCamera2;
    }
Esempio n. 2
0
    // Use this for initialization
    private void Start()
    {
        rBody      = GetComponent <Rigidbody>();
        pirateAnim = GetComponent <Animator>();

        //set intial respawnLoc
        respawnLocation = transform.position;

        //make it so pirates and parrots can't collide
        Physics.IgnoreLayerCollision(10, 9);

        //Get stuff from the game manager
        GameManager       gm       = GameManager.Instance;
        SplitScreenCamera ssCamera = gm.GetComponent <SplitScreenCamera>();

        switch (playerNum)
        {
        case 1:
            gameCamera = ssCamera.CaptainCamera1.transform;     //Get the camera
            break;

        case 2:
            gameCamera = ssCamera.CaptainCamera2.transform;     //Get the camera
            break;
        }

        //get input manager based on player num
        switch (playerNum)
        {
        case 1:
            inputManager = gm.P1Input;
            break;

        case 2:
            inputManager = gm.P2Input;
            break;
        }

        //pirateActive = true;
    }
Esempio n. 3
0
 private void SetRectTransform(SplitScreenCamera camera, float positionX, float positionY, float sizeX, float sizeY)
 {
     camera.rect.x      = positionX; camera.rect.y = positionY;
     camera.rect.width  = sizeX; camera.rect.height = sizeY;
     camera.camera.rect = camera.rect;
 }