private void Awake() { _instance = this; _skybox = RenderSettings.skybox; _moonDir = moonDir.transform.rotation * Vector3.forward; _startPos = RotateAroundMoon(focusSpot, -50.0f); _endPos = RotateAroundMoon(focusSpot, 50.0f); /*// Normalize the resting positions * for( int i = 0; i < restingPositions.Length; i++ ) * { * restingPositions[i] = restingPositions[i].normalized; * }*/ _skybox.SetFloat(moonPhase, 0.3f); ResetZodiac(); }
private void RingSegmentChanged(int i, int segment) { //@NOTE: The numbers on the graphic are backwards. code[i] = (8 - segment) % 8 + 1; string codeString = string.Join("", code); Debug.Log(codeString); int index = codes.IndexOf(codeString); if (index >= 0) { if (index < plants.Count) { var item = plants[index]; if (!InventoryManager.Contains(item) && !GlobalState.HasThisSpawned(item)) { // We made a new thing, woot GlobalState.MakeThisSpawn(item); SFXManager.PlaySoundAt(SFXManager.ClipCategory.CorrectZodiac, transform.position); } else { // We repeated an old pattern, play a sound, but not as happy :( SFXManager.PlaySoundAt(SFXManager.ClipCategory.ZodiacMoved, transform.position); } } SkyboxZodiac.SetZodiac(codesToZodiac[index]); } else { // This is an invalid code. Get rid of the zodiac SkyboxZodiac.SetZodiac(-1); } }