示例#1
0
 // Use this for initialization
 void Start()
 {
     if (GameObject.FindWithTag("MainCamera"))
     {
         camera = GameObject.FindWithTag("MainCamera").GetComponent<Camera>().GetComponent<MaxCamera>();
     }
 }
示例#2
0
 private void OnTriggerStay2D(Collider2D other){
     if (other.CompareTag("MaxCam")){
         MaxCamera maxCam = other.GetComponent<MaxCamera>();
         Camera.main.GetComponent<KidoCamera>().SetTempTarget(maxCam.transform, maxCam.CenterSpeed, maxCam.targetSize);
         TouchingMaxCam = true;
     }
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     if (GameObject.FindWithTag("MainCamera"))
     {
         camera = GameObject.FindWithTag("MainCamera").GetComponent <Camera>().GetComponent <MaxCamera>();
     }
 }
示例#4
0
    // Use this for initialization

    void OnEnable()
    {
        camscript = (MaxCamera)FindObjectOfType(typeof(MaxCamera));
        if (camscript)
        {
            StartCoroutine(_Start());
        }
    }
示例#5
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("menus start");

        helpStyle = new GUIStyle();
        black     = (Texture2D)Resources.Load("Materials/black") as Texture2D;

        helpStyle.normal.background = black;
        helpStyle.normal.textColor  = Color.white;
        mainCamera = GameObject.Find("Main Camera");
        //mainCamera.transform.position = pos;
        cameraScript = (MaxCamera)Camera.main.GetComponent(typeof(MaxCamera));

        labelStyle.normal.textColor = Color.black;

        /* create dictionary of menu/gui panels so they can be deactivated and yet
         * still found by the menus script and whatever else may need to name them. */
        GameObject acl_panel = GameObject.Find("ACLPanel");

        menu_panels["ACLPanel"] = acl_panel;
        acl_panel.SetActive(false);

        GameObject computer_panel = GameObject.Find("ComputerPanel");

        menu_panels["ComputerPanel"] = computer_panel;
        computer_panel.SetActive(false);

        GameObject zone_panel = GameObject.Find("ZonePanel");

        menu_panels["ZonePanel"] = zone_panel;
        zone_panel.SetActive(false);

        GameObject user_panel = GameObject.Find("UserPanel");

        menu_panels["UserPanel"] = user_panel;
        user_panel.SetActive(false);

        GameObject message_panel = GameObject.Find("MessagePanel");

        menu_panels["MessagePanel"] = message_panel;
        message_panel.SetActive(false);

        GameObject yesno_panel = GameObject.Find("YesNoPanel");

        menu_panels["YesNoPanel"] = yesno_panel;
        yesno_panel.SetActive(false);

        GameObject help_tip_panel = GameObject.Find("HelpTip");

        menu_panels["HelpTip"] = help_tip_panel;
        help_tip_panel.SetActive(false);

        screen_dict["Objectives"] = UI_SCREEN_OBJECTIVE;
    }
    public static void AfterServerReady()
    {
        LoadItems();
        Debug.Log("Back from LoadItems");

        GameObject mainCamera = GameObject.Find("Main Camera");

        //		Vector3 pos = new Vector3(40.0f, 3.0f, 33.0f);
        //		Quaternion rot = Quaternion.Euler(11.8f, 0.0f, 0.0f);

        //mainCamera.transform.position = pos;
        mainCamera.transform.rotation = home_rot;
        MaxCamera cameraScript = (MaxCamera)Camera.main.GetComponent(typeof(MaxCamera));

        cameraScript.setPosition(home_pos);
    }
示例#7
0
 private void LateUpdate()
 {
     if (Input.GetMouseButton(2) && Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.LeftControl))
     {
         this.desiredDistance -= Input.GetAxis("Mouse Y") * Time.deltaTime * (float)this.zoomRate * 0.125f * Mathf.Abs(this.desiredDistance);
     }
     else if (Input.GetMouseButton(0) && Input.GetKey(KeyCode.LeftAlt))
     {
         this.xDeg              += Input.GetAxis("Mouse X") * this.xSpeed * 0.02f;
         this.yDeg              -= Input.GetAxis("Mouse Y") * this.ySpeed * 0.02f;
         this.yDeg               = MaxCamera.ClampAngle(this.yDeg, (float)this.yMinLimit, (float)this.yMaxLimit);
         this.desiredRotation    = Quaternion.Euler(this.yDeg, this.xDeg, 0f);
         this.currentRotation    = base.transform.rotation;
         this.rotation           = Quaternion.Lerp(this.currentRotation, this.desiredRotation, Time.deltaTime * this.zoomDampening);
         base.transform.rotation = this.rotation;
     }
     this.desiredDistance   -= Input.GetAxis("Mouse ScrollWheel") * Time.deltaTime * (float)this.zoomRate * Mathf.Abs(this.desiredDistance);
     this.desiredDistance    = Mathf.Clamp(this.desiredDistance, this.minDistance, this.maxDistance);
     this.currentDistance    = Mathf.Lerp(this.currentDistance, this.desiredDistance, Time.deltaTime * this.zoomDampening);
     this.position           = this.target.position - (this.rotation * Vectors.forward * this.currentDistance + this.targetOffset);
     base.transform.position = this.position;
 }