mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-24 05:35:38 +03:00
04.07.2022
This commit is contained in:
56
Heli_with_panels/Assets/Scripts/UI/Switch2gruz.cs
Normal file
56
Heli_with_panels/Assets/Scripts/UI/Switch2gruz.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
|
||||
public class Switch2gruz : MonoBehaviour, IPointerClickHandler//, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
[HideInInspector] public Manager manager;
|
||||
|
||||
/* [Header("Objects for SetActive")]
|
||||
[SerializeField] private GameObject _fusel;
|
||||
[SerializeField] private GameObject _cabines;
|
||||
[SerializeField] private GameObject _quit;*/
|
||||
|
||||
private void Start()
|
||||
{
|
||||
manager = GameObject.Find("Manager").GetComponent<Manager>();
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
if (manager == null)
|
||||
manager = GameObject.Find("Manager").GetComponent<Manager>();
|
||||
if (!manager.is3D) manager.SwitchTo3D();
|
||||
manager.viewmode = 2; // Переключились в пассажирский отсек
|
||||
//if(manager.mode == "view")
|
||||
// manager.mode = "free";
|
||||
manager.fusel.SetActive(false);
|
||||
manager.cabines2d.SetActive(true);
|
||||
manager.copterProz.SetActive(false);// Отключать прозрачный вертолет при выходе из обзорки
|
||||
|
||||
//**********for Max Project*********
|
||||
/* _fusel.SetActive(false);
|
||||
_cabines.SetActive(true);
|
||||
_quit.SetActive(true);*/
|
||||
//**********************************
|
||||
|
||||
//Camera.main.transform.position = new Vector3(-11924f, 404f, 416f); Old camera position
|
||||
Camera.main.transform.position = new Vector3(-5.4f, 2.5f, 5.2f);
|
||||
Camera.main.transform.rotation = Quaternion.Euler(20, 180f, 0f);
|
||||
Camera.main.farClipPlane = 200f;
|
||||
//Component.Destroy(Camera.main.gameObject.GetComponent<forCamera>());
|
||||
Camera.main.GetComponent<forCamera>().limitVert = 179.99f;
|
||||
Camera.main.fieldOfView = 50f;
|
||||
|
||||
manager.ChangeLayerPassCabineDefault();
|
||||
manager.ChangeLayerPilotCabineIgnore();
|
||||
// Включаем коллайдеры для внутренних кабин
|
||||
manager.EnablePassCabineCollider();
|
||||
manager.EnablePilotCabineCollider();
|
||||
|
||||
manager.mouseEnterUI();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user