Esempio n. 1
0
    /*void SetPos(Vector3 pos, bool puzzle){
     *
     *      transform.position = pos;
     *
     *      //if puzzle = true then turn off smoothfollow
     *      if(puzzle){
     *              isFollowing = false;
     *      }else{
     *              isFollowing = true;
     *      }
     *
     * }*/

    void SetPos(CameraChangePos x)
    {
        transform.position = x.pos;

        //if puzzle = true then turn off smoothfollow
        if (x.isPuzzle)
        {
            isFollowing = false;
        }
        else
        {
            isFollowing = false;
        }
    }
    void Deactivate()            // deactivate current ZDB
    {
        if (zoomList.Count != 0) // make sure we have a zoom to deactivate first
        //ZDB temp = zoomQueue.Peek() as ZDB;// use the latest zoom
        {
            ZDB temp = zoomList[zoomList.Count - 1];
            if (temp.uses_puzzel)
            {
                if (temp.current_manager != null)
                {
                    temp.current_manager.Active(false);                            // activate the current pussel-manager
                }
                else
                {
                    //Debug.LogError("Pussel-manager couldn't be activated");
                }
            }
            GameObject.Find(temp.name).GetComponent <GUI_Parent>().Activate(false);             // activates the GUI-components of the current zoom.

            if (zoomList.Count == 1)
            {
                //Debug.Log("You left the zoom");
                GameObject.Find("MasterMind").SendMessage("SetIsPuzzle", false);                                                // Let the input manager know we are in a puzzel.
            }
            //-------------------------
            cam_ref.gameObject.SetActive(true);
            //cam_ref.GetComponent<AudioListener>().enabled		= true;
            //temp.zoom_cam.GetComponent<AudioListener>().enabled	= false;
            temp.zoom_cam.gameObject.SetActive(false);            //        = false;
            //-------------------------
            CameraChangePos messenger = new CameraChangePos();    /* Change the camera position and let it know we are in puzzel mode   */
            //messenger.pos                 = temp.deactive_pos;	0,			/*  Uses a struct with a position and a bool as a data messenger		*/
            messenger.pos      = Camera.main.transform.position;
            messenger.isPuzzle = (zoomList.Count == 1 ? false : true);                                                                                  /*																		*/

            //cam_ref.SendMessage("SetPos", false);					// the new camera position is set.
            //cam_ref.SendMessage("SetZoom", false);					// the new camera position is set.
            DeacitivateCurrent();               // remove the deactive zoom from the manager.
            if (zoomList.Count != 0)            // if there is another
            {
                Activate();
            }
            else
            {
                //Debug.Log ("Can't deactivate the zoom because the is no zoom active (the queue is empty)");
            }
        }
    }
	/*void SetPos(Vector3 pos, bool puzzle){
		
		transform.position = pos;
		
		//if puzzle = true then turn off smoothfollow
		if(puzzle){
			isFollowing = false;
		}else{
			isFollowing = true;
		}
		
	}*/
	
	void SetPos(CameraChangePos x){
		
		transform.position = x.pos;
		
		//if puzzle = true then turn off smoothfollow
		if(x.isPuzzle){
			isFollowing = false;
		}else{
			isFollowing = false;
		}
		
	}
Esempio n. 4
0
	void Deactivate(){// deactivate current ZDB
		if(zoomList.Count != 0){// make sure we have a zoom to deactivate first
			//ZDB temp = zoomQueue.Peek() as ZDB;// use the latest zoom
					ZDB temp = zoomList[zoomList.Count - 1];
				if(temp.uses_puzzel){
					if(temp.current_manager != null){
						temp.current_manager.Active(false);// activate the current pussel-manager	
					}else{
						//Debug.LogError("Pussel-manager couldn't be activated");
					}
				}
			GameObject.Find(temp.name).GetComponent<GUI_Parent>().Activate(false);	// activates the GUI-components of the current zoom.
			
			if(zoomList.Count == 1){
				//Debug.Log("You left the zoom");
				GameObject.Find("MasterMind").SendMessage("SetIsPuzzle", false);				// Let the input manager know we are in a puzzel.
			}
			//-------------------------
			cam_ref.gameObject.SetActive(true); 
			//cam_ref.GetComponent<AudioListener>().enabled		= true;
			//temp.zoom_cam.GetComponent<AudioListener>().enabled	= false;
			temp.zoom_cam.gameObject.SetActive(false);// 		= false;
			//-------------------------
			CameraChangePos messenger 	= new CameraChangePos();			/* Change the camera position and let it know we are in puzzel mode 	*/
			//messenger.pos 				= temp.deactive_pos;	0,			/*  Uses a struct with a position and a bool as a data messenger		*/
			messenger.pos 				= Camera.main.transform.position;	
			messenger.isPuzzle 			= (zoomList.Count == 1 ? false : true);							/*																		*/
			
		//cam_ref.SendMessage("SetPos", false);					// the new camera position is set.
			//cam_ref.SendMessage("SetZoom", false);					// the new camera position is set.
			DeacitivateCurrent();											// remove the deactive zoom from the manager.
			if(zoomList.Count != 0){// if there is another 
				Activate ();	
			}else{
				//Debug.Log ("Can't deactivate the zoom because the is no zoom active (the queue is empty)");
			}
		}
	}