private void SelectSpectra() { Camera.main.GetComponent <Camera2DFollow>().ChangeSize(8); _currentSpectra.GetComponent <PlayerController>().Deactivate(); if (_playerFocused) { //DeactivateLens(); return; } LensMapping map = d_ColorInput[_focusedColor]; if (map.Spectra != null) { _currentSpectra = map.Spectra; } else { GameObject newSpectra = m_SpectraDictionary.GetSpectra(_focusedColor); map.Spectra = (GameObject)Instantiate(newSpectra, _lens.transform.position, Quaternion.identity); _currentSpectra = map.Spectra; d_ColorInput[_focusedColor] = map; Debug.Log("Spectra created"); Debug.Log(d_ColorInput[_focusedColor].Spectra); } _currentSpectra.GetComponent <PlayerController>().Activate(); Camera.main.GetComponent <Camera2DFollow>().ChangeTarget(_currentSpectra.transform); }
private void SwitchSpectra(ColorEnum color) { _focusedColor = color; LensMapping map = d_ColorInput[color]; if (map.Equals(null)) { Debug.Log(string.Format("ERROR: Color[{0}] does not exist in mapping", color)); return; } if (map.Locked) { return; } if (map.Spectra != null) { GameObject focusSpectra = m_SpectraDictionary.GetSpectra(color); string spectraName = string.Format(focusSpectra.name + "(Clone)"); Debug.Log(string.Format("Looking for Spectra with name [{0}]", spectraName)); Camera.main.GetComponent <Camera2DFollow>().ChangeTarget(GameObject.Find(spectraName).transform); } else { Debug.Log(string.Format("No active spectra for color [{0}] found", color)); Camera.main.GetComponent <Camera2DFollow>().ChangeTarget(_lens.transform); } _playerFocused = false; SelectSpectra(); }
private void MapSpectraColors() { Debug.Log("Mapping Colors"); List <ColorEnum> lensColors = _lens.GetComponent <SpectraLens>().SpectraColors; ResetColorDictionary(); foreach (ColorEnum ce in lensColors) { Debug.Log(string.Format("Color [{0}] active in lens", ce)); LensMapping map = d_ColorInput[ce]; map.Locked = false; d_ColorInput[ce] = map; } }