void Awake() { touchable = gameObject.GetComponent <Touchable>(); boxcollider = gameObject.GetComponent <BoxCollider>(); rigidbody = gameObject.GetComponent <Rigidbody>(); default_storage_scale = storage.transform.localScale.x; //could grab any dimension storage_ghost = storage.GetComponent <Ghost>(); storage_touchable = storage.GetComponent <Touchable>(); storage_available = storage_ghost.available; storage_available_meshrenderer = storage_available.GetComponent <MeshRenderer>(); storage_snap = storage_ghost.snap; storage_snap_meshrenderer = storage_snap.GetComponent <MeshRenderer>(); active_ghost = active.GetComponent <Ghost>(); active_touchable = active.GetComponent <Touchable>(); active_available = active_ghost.available; active_available_meshrenderer = active_available.GetComponent <MeshRenderer>(); active_snap = active_ghost.snap; active_snap_meshrenderer = active_snap.GetComponent <MeshRenderer>(); dial_dial = dial.GetComponent <Dial>(); dial_touchable = dial.GetComponent <Touchable>(); textv_tmpro = textv.GetComponent <TextMeshPro>(); textv_meshrenderer = textv.GetComponent <MeshRenderer>(); textl_tmpro = textl.GetComponent <TextMeshPro>(); textl_meshrenderer = textl.GetComponent <MeshRenderer>(); text_fadable = GetComponent <Fadable>(); disabled = false; }
// Update is called once per frame void Update() { //Меняем время по W if (Input.GetKeyDown(KeyCode.W) && isSwitchPossible) { Fadable map1 = GameObject.Find("Map1").GetComponent <Fadable>(); Fadable map2 = GameObject.Find("Map2").GetComponent <Fadable>(); if (state == 1) { map1.EnableCollision(); map2.DisableCollision(); StartCoroutine(map1.FadeImage(false)); StartCoroutine(map2.FadeImage(true)); state = 0; } else { map2.EnableCollision(); map1.DisableCollision(); StartCoroutine(map1.FadeImage(true)); StartCoroutine(map2.FadeImage(false)); state = 1; } SwitchPlayer(); } }
private void Start() { if (_music_slider && _sound_slider) { _music_slider.value = GetMusicVolume(); _sound_slider.value = GetSoundVolume(); } _fadable = GetComponent <Fadable>(); _music_manager = FindObjectOfType <MusicManager>(); }
private void Awake() { Fadable map1 = GameObject.Find("Map1").GetComponent <Fadable>(); Fadable map2 = GameObject.Find("Map2").GetComponent <Fadable>(); StartCoroutine(map1.FadeImage(true)); map1.DisableCollision(); Transform tmap1 = GameObject.Find("Map1").GetComponent <Transform>(); Transform tmap2 = GameObject.Find("Map2").GetComponent <Transform>(); tmap2.position = new Vector3(0, 0, 0); tmap1.position = new Vector3(0, 0, 0); }
public void FadeInOptionsMenu(float time, float buffer, Fadable BackMenu) { _back_menu = BackMenu; _fadable.FadeIn(time, buffer); }
public void Start() { _canvasGroup = GetComponent <CanvasGroup>(); _fadable = GetComponent <Fadable>(); }