public void Answer() { if (state > CallState.NONE && !ConversationManager.Instance.HasCall) { FunManager.AddFun(2.0f); state = CallState.ANSWERED; spriteRenderer.sprite = normal; spriteRenderer.color = new Color(114f / 255f, 1f, 197f / 255f, 1f); ConversationManager.Instance.StartConvo(conversation); } }
//TODO: fix this, it's really bad private void MusicUpdate() { float thisK = Input.GetAxisRaw("Knob"); float dist = thisK - lastKnob; scratch = Input.GetButton("X"); if (scratch) { } else { if (Mathf.Abs(ScratchAmount) > 0.1f) { MusicManager.Instance.SpinUp(); } } if (Input.GetButtonUp("X")) { scratch = false; MusicManager.Instance.Unscratch(); } if (Input.GetButtonDown("Y")) { FunManager.AddFun(10.0f); MusicManager.Instance.PlayHorn(); } if (is_a_DJ) { if (Mathf.Abs(dist) > knobThreshold) { if (dist > 1f) { float t = -1 - lastKnob; float t2 = 1 - thisK; dist = t - t2; // Debug.Log("Tick down"); } else if (dist < -1f) { float t = 1 - lastKnob; float t2 = -1 - thisK; dist = t - t2; } if (dist > 0) { MusicManager.Instance.ChangeSelection(1); } else { MusicManager.Instance.ChangeSelection(-1); } lastKnob = Input.GetAxisRaw("Knob"); } } else { if (Input.GetKeyDown(KeyCode.UpArrow)) { MusicManager.Instance.ChangeSelection(-1); } if (Input.GetKeyDown(KeyCode.DownArrow)) { MusicManager.Instance.ChangeSelection(1); } } if (Input.GetButtonDown("A") && MusicManager.Instance.currentSong == null) { MusicManager.Instance.SelectCurrent(); } if (Input.GetButtonDown("B") && !Input.GetButton("X")) { MusicManager.Instance.StopSong(); } }
// Use this for initialization void Awake() { Instance = this; }