Example #1
0
 public void OnAwake(MonoBehaviour monoBehaviour)
 {
     pivot  = monoBehaviour.transform.Find("Pivot").transform;
     camera = pivot.transform.Find("Camera")
              .GetComponent <Camera>();
     leanPitchYawSmooth   = pivot.GetComponent <LeanPitchYawSmooth>();
     leanCameraMoveSmooth = pivot.GetComponent <LeanCameraMoveSmooth>();
     leanCameraZoomSmooth = pivot.GetComponent <LeanCameraZoomSmooth>();
 }
 public void ChangeCameraView(GameObject target)
 {
     SetDefaultRotation();
     //Debug.Log("target2 : "+target.name);
     ZoomScript      = currentCamera.GetComponent <LeanCameraZoomSmooth>();
     ZoomScript.Zoom = 40;
     currentCamera.transform.localEulerAngles = new Vector3(60f, 135f, 0f);
     currentCamera.transform.position         = target.transform.position + offset;
     //Debug.Log(target.transform.position + offset);
 }
    public void SetDefaultView()
    {
        SetDefaultRotation();
        backButton.GetComponent <BackStage>().IsResult = false;
        ZoomScript      = currentCamera.GetComponent <LeanCameraZoomSmooth>();
        ZoomScript.Zoom = 120;
        LeanCameraMoveSmooth LCMS = currentCamera.GetComponent <LeanCameraMoveSmooth>();

        LCMS.ClampPositionX_max = -20f;
        LCMS.ClampPositionX_min = -150f;
        currentCamera.transform.localEulerAngles = new Vector3(30f, 135f, 0f);
        currentCamera.transform.position         = new Vector3(-95.11f, 186.56f, 118.63f);
        if (currentChar != null)
        {
            Destroy(currentChar);
        }
        currentChar = null;
        currentCamera.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
        if (MainBuilding[0].activeSelf)
        {
            ShowOnlyTargetObject("MATH", "0");
        }
        if (MainBuilding[1].activeSelf)
        {
            LCMS.ClampPositionX_max += 100f;
            currentCamera.GetComponent <LeanCameraMoveSmooth>().ClampPositionX_min += 100f;
            currentCamera.transform.position += new Vector3(100f, 0f, 0f);
            ShowOnlyTargetObject("CHEM2", "0");
        }
        if (MainBuilding[2].activeSelf)
        {
            LCMS.ClampPositionX_max          += 300f;
            LCMS.ClampPositionX_min          += 300f;
            currentCamera.transform.position += new Vector3(300f, 0f, 0f);
            ShowOnlyTargetObject("MHMK", "0");
        }
        if (MainBuilding[3].activeSelf)
        {
            LCMS.ClampPositionX_max          += 400f;
            LCMS.ClampPositionX_min          += 400f;
            currentCamera.transform.position += new Vector3(400f, 0f, 0f);
            ShowOnlyTargetObject("TAB", "0");
        }
        currentCamera.transform.localEulerAngles = new Vector3(30f, 135f, 0f);
        moveView.SetActive(true);
        googleButton.SetActive(true);
        MainBuilding[0].GetComponent <Lean.Touch.LeanRotate>().enabled         = true;
        MainBuilding[1].GetComponent <Lean.Touch.LeanRotate>().enabled         = true;
        MainBuilding[2].GetComponent <Lean.Touch.LeanRotate>().enabled         = true;
        MainBuilding[3].GetComponent <Lean.Touch.LeanRotate>().enabled         = true;
        currentCamera.GetComponent <Lean.Touch.LeanCameraZoomSmooth>().enabled = true;
        currentCamera.GetComponent <Lean.Touch.LeanCameraMoveSmooth>().enabled = true;
    }
Example #4
0
        // Start is called before the first frame update
        void Start()
        {
            cam      = GameObject.Find("Camera").gameObject;
            leanZoom = cam.GetComponent <LeanCameraZoomSmooth>();

            if (!mapActive)
            {
                leanZoom.enabled = false;
            }
            else
            {
                leanZoom.enabled = true;
            }

            versionNo.text = "v: " + Application.version;

            ChapterSelectScreen(false);


            if (PlayerPrefs.HasKey("loadMap"))// && GameObject.Find("DontDestroy(Clone)") != null)
            {
                var n = PlayerPrefs.GetInt("loadMap");
                print("loading map after game");
                PlayerPrefs.DeleteKey("loadMap");
                ShowMap(n);
            }

            c1  = new Color(0, 0, 0, 0);          // clear
            c2  = new Color(0.1f, 0.3f, 0.7f, 1); // blue
            c2b = new Color(0.2f, 0.4f, 0.9f, 1); // blue
            c3  = new Color(1, 1, 1, 1);          // white

            //s1 = new Vector3(0.95f, 0.95f, 0.95f);
            //s2 = new Vector3(1f, 1f, 1f);

            anim = startButton.GetComponent <Animator>();
            ButtonSizePong();
        }