Inheritance: MonoBehaviour
Esempio n. 1
0
    void Start()
    {
        initPos    = gameObject.transform.position;
        value      = 0;
        changeView = GameObject.Find("Gestione camera").GetComponent <SwitchCamera>();
        if (directions.Count == 0)
        {
            // Object space directions
            directions.Add(Vector3.up);
            sideValues.Add(5);              // up
            directions.Add(Vector3.down);
            sideValues.Add(2);              // down

            directions.Add(Vector3.left);
            sideValues.Add(3);              // left
            directions.Add(Vector3.right);
            sideValues.Add(4);              // right

            directions.Add(Vector3.forward);
            sideValues.Add(1);              // fw
            directions.Add(Vector3.back);
            sideValues.Add(6);              // back
            rb = this.GetComponent <Rigidbody> ();
        }
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        controller1  = GameObject.FindGameObjectWithTag("BigPlayer").GetComponent <CharacterController>();
        controller2  = GameObject.FindGameObjectWithTag("SmallPlayer").GetComponent <CharacterController>();
        cameraScript = GameObject.Find("Y_Cameras").GetComponent <SwitchCamera>();
        camera       = cameraScript.currentCam;

        groundY1 = controller1.transform.position.y;
        groundY2 = controller2.transform.position.y;
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        camera = GameObject.Find("Y_Cameras").GetComponent <SwitchCamera>();

        player1 = GameObject.Find("Player1").GetComponent <Y_PlayerController>();
        player2 = GameObject.Find("Player2").GetComponent <Y_PlayerController>();

        controller1 = GameObject.FindGameObjectWithTag("BigPlayer").GetComponent <CharacterController>();
        controller2 = GameObject.FindGameObjectWithTag("SmallPlayer").GetComponent <CharacterController>();
    }
Esempio n. 4
0
    void Start()
    {
        _controller   = GetComponent <CharacterController>();
        _uiManager    = GameObject.Find("Canvas").GetComponent <UIManager>();
        _base         = GameObject.Find("Base").GetComponent <Transform>();
        _anim         = astronaut.GetComponent <Animator>();
        _switchCamera = GameObject.Find("CM vcam2").GetComponent <SwitchCamera>();
        _audioSource  = GetComponent <AudioSource>();

        FindObjectOfType <AudioManager>().Play("Background");
    }
Esempio n. 5
0
    private void Start()
    {
        if (gameObject.name == "HighScores")
        {
            Debug.Log("I am in main menu");
            LeaderBoard = FindObjectOfType <HighScoreManager>().gameObject;
            LeaderBoard.SetActive(false);
        }

        cameraManager     = FindObjectOfType <SwitchCamera>();
        SpawnerController = FindObjectOfType <SpawnManager>();
    }
Esempio n. 6
0
    public void toggleCameraWhenInFirstPerson()
    {
        camera = new SwitchCamera();
        var cam = GetCamMock();

        camera.SetCameraController(cam);

        camera.assignStartValues(new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
        setValues();
        camera.fperson = true;
        camera.leftAltkey();

        Assert.AreEqual(camera.fperson, false);
    }
    public void putBackCameraWhenInFirstPerson()
    {
        camera = new SwitchCamera();
        var cam = GetCamMock();
        camera.SetCameraController(cam);

        camera.assignStartValues(new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
        setValues();
        camera.fperson = true;
        camera.putBackCamera();

        cam.Received().SetPosition(firstPersonPos);
        cam.Received().SetRotation(firstPersonRot);
    }
    public void putBackCameraWhenInThirdPerson()
    {
        camera = new SwitchCamera();
        var cam = GetCamMock();
        camera.SetCameraController(cam);

        camera.assignStartValues(new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
        setValues();
        camera.fperson = false;
        camera.putBackCamera();

        cam.Received().SetPosition(lookForwardPos);
        cam.Received().SetRotation(lookForwardRot);
    }
    public void lookBack(){
        camera = new SwitchCamera();
        var cam = GetCamMock();
        camera.SetCameraController(cam);

        camera.assignStartValues(new Vector3(0,0,0), new Quaternion(0,0,0,0));
        setValues();

        //Alt was pressed
        camera.leftShiftkey();

        cam.Received().SetPosition(lookBackPos);
        cam.Received().SetRotation(lookBackRot);
    }
Esempio n. 10
0
    public void putBackCameraWhenInThirdPerson()
    {
        camera = new SwitchCamera();
        var cam = GetCamMock();

        camera.SetCameraController(cam);

        camera.assignStartValues(new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
        setValues();
        camera.fperson = false;
        camera.putBackCamera();

        cam.Received().SetPosition(lookForwardPos);
        cam.Received().SetRotation(lookForwardRot);
    }
Esempio n. 11
0
    public void putBackCameraWhenInFirstPerson()
    {
        camera = new SwitchCamera();
        var cam = GetCamMock();

        camera.SetCameraController(cam);

        camera.assignStartValues(new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
        setValues();
        camera.fperson = true;
        camera.putBackCamera();

        cam.Received().SetPosition(firstPersonPos);
        cam.Received().SetRotation(firstPersonRot);
    }
Esempio n. 12
0
    public void lookBack()
    {
        camera = new SwitchCamera();
        var cam = GetCamMock();

        camera.SetCameraController(cam);

        camera.assignStartValues(new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
        setValues();

        //Alt was pressed
        camera.leftShiftkey();

        cam.Received().SetPosition(lookBackPos);
        cam.Received().SetRotation(lookBackRot);
    }
Esempio n. 13
0
    // Use this for initialization
    void Start()
    {
        sc                   = GameObject.Find("Gestione camera").GetComponent <SwitchCamera> ();
        isMyTurn             = false;
        isInRoom             = false;
        usatoBotola          = false;
        lanciatoDadi         = false;
        miSonoSpostato       = false;
        fattoIpotesi         = false;
        fattoAccusa          = false;
        dado1                = GameObject.Find("dado").GetComponent <dice>();
        dado2                = GameObject.Find("dado 2").GetComponent <dice>();
        colliderDadi         = GameObject.Find("ColliderDadi");
        saveState            = new bool[5];
        movedAfterHypothesis = false;

        piantinaIsActive = false;
    }
Esempio n. 14
0
    public void initializeValues()
    {
        camera = new SwitchCamera();
        var cam = GetCamMock();
        camera.SetCameraController(cam);

        Vector3 localPosition = new Vector3(0, 0, 0);
        Quaternion localRotation = new Quaternion(0, 0, 0, 0);

        camera.assignStartValues(localPosition, localRotation);
        setValues();



        Assert.AreEqual(lookForwardPos, camera.lookForwardPos);
        Assert.AreEqual(lookForwardRot, camera.lookForwardRot);
        Assert.AreEqual(lookBackPos, camera.lookBackPos);
        Assert.AreEqual(lookBackRot, camera.lookBackRot);
        Assert.AreEqual(camera.fperson,false);
        Assert.AreEqual(firstPersonPos, camera.firstPersonPos);
        Assert.AreEqual(firstPersonRot, camera.firstPersonRot);

    }
Esempio n. 15
0
    public void initializeValues()
    {
        camera = new SwitchCamera();
        var cam = GetCamMock();

        camera.SetCameraController(cam);

        Vector3    localPosition = new Vector3(0, 0, 0);
        Quaternion localRotation = new Quaternion(0, 0, 0, 0);

        camera.assignStartValues(localPosition, localRotation);
        setValues();



        Assert.AreEqual(lookForwardPos, camera.lookForwardPos);
        Assert.AreEqual(lookForwardRot, camera.lookForwardRot);
        Assert.AreEqual(lookBackPos, camera.lookBackPos);
        Assert.AreEqual(lookBackRot, camera.lookBackRot);
        Assert.AreEqual(camera.fperson, false);
        Assert.AreEqual(firstPersonPos, camera.firstPersonPos);
        Assert.AreEqual(firstPersonRot, camera.firstPersonRot);
    }
 private void OnEnable()
 {
     cameraController = new SwitchCamera();
     cameraController.SetCameraController(this);
     cameraController.assignStartValues(this.transform.localPosition, this.transform.localRotation);
 }
Esempio n. 17
0
 // Use this for initialization
 void Start()
 {
     currentCamera   = GameObject.Find("Y_Cameras").GetComponent <SwitchCamera>();
     player          = GameObject.Find("Player2").GetComponent <Y_PlayerController>();
     followingCamera = GameObject.Find("Main Camera4").GetComponent <Y_FollowCamera>();
 }
Esempio n. 18
0
 // Use this for initialization
 void Start()
 {
     camera  = GameObject.Find("Y_Cameras").GetComponent <SwitchCamera>();
     player1 = GameObject.Find("Player1").GetComponent <Y_PlayerController>();
     player2 = GameObject.Find("Player2").GetComponent <Y_PlayerController>();
 }
Esempio n. 19
0
 // Start is called before the first frame update
 void Start()
 {
     playerStats  = player.GetComponent <PlayerStats>();
     modeDetector = GameObject.Find("ModeDetector").GetComponent <ModeDetector>();
     switchCamera = gameObject.GetComponent <SwitchCamera>();
 }
Esempio n. 20
0
 void Start()
 {
     arduino = new Arduino();
     zapping = GetComponent<Zapping>();
     switchCamera = GetComponent<SwitchCamera>();
 }
Esempio n. 21
0
 void Awake()
 {
     share = this;
 }
Esempio n. 22
0
 void Start()
 {
     _player       = GameObject.Find("Player").GetComponent <Player>();
     _switchCamera = GameObject.Find("CM vcam2").GetComponent <SwitchCamera>();
 }
Esempio n. 23
0
 void Start()
 {
     arduino      = new Arduino();
     zapping      = GetComponent <Zapping>();
     switchCamera = GetComponent <SwitchCamera>();
 }
Esempio n. 24
0
    public void toggleCameraWhenInFirstPerson(){
        camera = new SwitchCamera();
        var cam = GetCamMock();
        camera.SetCameraController(cam);

        camera.assignStartValues(new Vector3(0, 0, 0), new Quaternion(0, 0, 0, 0));
        setValues();
        camera.fperson = true;
        camera.leftAltkey();

        Assert.AreEqual(camera.fperson, false);
    }
Esempio n. 25
0
 // Use this for initialization
 void Start()
 {
     camera = GameObject.Find("Y_Cameras").GetComponent <SwitchCamera>();
 }
 private void OnEnable()
 {
     cameraController = new SwitchCamera();
     cameraController.SetCameraController(this);
     cameraController.assignStartValues(this.transform.localPosition, this.transform.localRotation);
 }
Esempio n. 27
0
 void Start()
 {
     _switchCamera = GameObject.Find("CM vcam2").GetComponent <SwitchCamera>();
 }
Esempio n. 28
0
 void OnEnable()
 {
     changeView = GameObject.Find("Gestione camera").GetComponent <SwitchCamera>();
     grid       = GetComponent <Grid> ();
     colliderr  = GameObject.Find("ColliderDadi");
 }