public void ColorChangeFunc(bool Change) { lerp = 0; ChangeColor = Change; if (ChangeColor) { NewColor = BackgroundSettings.GetLevelColor(); } else { ColorSave = CurrentColor; } }
// Start is called before the first frame update void Start() { render = gameObject.transform.GetChild(0).GetComponent <Renderer>(); BackgroundSettings = GameObject.Find("Backgrounds").GetComponent <Backgrounds>(); CurrentColor = BackgroundSettings.GetLevelColor(); ColorSave = CurrentColor; render.material.SetVector("_EmissionColor", new Vector4(CurrentColor.r, CurrentColor.g, CurrentColor.b) * Emission); if (Obstacles) { BackgroundSettings.OtherReferences.Add(gameObject); } else { BackgroundSettings.ObstaclesReferences.Add(gameObject); } Player = GameObject.Find("character"); }
public void SetPause(bool GameOver) { if (!PausePanel.active) { Time.timeScale = 0; MainText.sprite = MainTextTexture[0]; MainText.rectTransform.sizeDelta = new Vector2(240, 132); ButtonResume.SetActive(true); PausePanel.SetActive(true); if (GameOver) { ButtonResume.SetActive(false); MainText.sprite = MainTextTexture[1]; MainText.color = BackgroundSettings.GetLevelColor(); MainText.rectTransform.sizeDelta = new Vector2(276, 71); } } }