void Update() { if (link != null) { link.GetComponent <Transform>().position = front.transform.position; Vector3 To; float div = 1.0f; if (nextBlock == null) { To = Input.mousePosition; } else { To = nextBlock.rear.GetComponent <RectTransform>().position; } Vector3 FromTo = To - front.transform.position; link.GetComponent <RectTransform>().sizeDelta = new Vector2(FromTo.magnitude / div, 5); // 0.64f c'est le scale du canvas scaler.... wtf mate link.GetComponent <RectTransform>().right = FromTo; } if (source != null && source.clip != null) { if (source.time >= source.clip.length - 0.5f) { if (source.loop && ((link == null) || !AppManager.Instance.GUIManager.ScenarioView.goToNextSound)) { source.time = 0; } else { AppManager.Instance.GUIManager.ScenarioView.goToNextSound = false; StopSound(); if (nextBlock) { nextBlock.PlaySound(); } } } float ratio = source.time / source.clip.length; slider.value = ratio; } }
public void StartSoundTrack() { firstBlock.PlaySound(); activeSoundBlock = firstBlock; isPlaying = true; }