// Use this for initialization void Start() { ani = tigerLogo.GetComponent<Animation>(); audios = GetComponent<AudioSource>(); st = GetComponent<StarAnimation>(); }
// Use this for initialization void Start() { ani = tigerLogo.GetComponent <Animation>(); audios = GetComponent <AudioSource>(); st = GetComponent <StarAnimation>(); }
IEnumerator CenterLaunch() { movement.enabled = false; transform.parent = null; DOTween.KillAll(); //Checks to see if there is a Camera Trigger at the DollyTrack object - if there is activate its camera if (launchObject.GetComponent <CameraTrigger>() != null) { launchObject.GetComponent <CameraTrigger>().SetCamera(); } //Checks to see if there is a Camera Trigger at the DollyTrack object - if there is activate its camera if (launchObject.GetComponent <SpeedModifier>() != null) { speedModifier = launchObject.GetComponent <SpeedModifier>().modifier; } //Checks to see if there is a Star Animation at the DollyTrack object if (launchObject.GetComponentInChildren <StarAnimation>() != null) { starAnimation = launchObject.GetComponentInChildren <StarAnimation>(); } dollyCart.m_Position = 0; dollyCart.m_Path = null; dollyCart.m_Path = launchObject.GetComponent <CinemachineSmoothPath>(); dollyCart.enabled = true; yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); Sequence CenterLaunch = DOTween.Sequence(); CenterLaunch.Append(transform.DOMove(dollyCart.transform.position, .2f)); CenterLaunch.Join(transform.DORotate(dollyCart.transform.eulerAngles + new Vector3(90, 0, 0), .2f)); CenterLaunch.Join(starAnimation.Reset(.2f)); CenterLaunch.OnComplete(() => LaunchSequence()); }