void TriggerAttract(bool input) { //m_handAnimator.SetBool("Attract", input); if (input) { if (Target) { m_wHandPlay.Post(gameObject); m_attract = true; Target.UseEffects = false; Target.isDistanceGrabbed = true; SetLevitation(Target, true); m_fxManager.Activate("Grab", Target.transform); m_fxManager.Activate("Grab_In", Target.transform); } } else { m_wHandStop.Post(gameObject); m_attract = false; m_fxManager.DeActivate("Grab"); if (Target) { if (IsLevitating(Target)) { m_fxManager.Activate("Grab_Out", Target.transform); } SetLevitation(Target, false); Target.UseEffects = true; Target.isDistanceGrabbed = false; } if (m_connectedBody) { UnAttract(); } } }
/// <summary> /// Shows a score FX animation at the location of the the dead pasta and /// updates the GUI total score /// </summary> /// <param name="position"></param> public void AddScore(Vector3 position) { // increase the number of total kills TotalPastaKills++; // get the current score value from the Pasta Manager (this score is incremented each kill) int newScore = pastaManager.CurrentPastaScore; // tell the FX manager to activate a score animation at the location of the kill fxManager.Activate(FX.FX_TYPE.Score, position + new Vector3(0, pastaManager.scoreYOffset, 0), 0, newScore.ToString()); // tell the GUI manager to update the total score guiManager.totalScore.SetScoreAndBounce(guiManager.totalScore.IntValue + newScore); // tell the GUI manager to update the pizza count guiManager.pizzaCountScore.SetScoreAndBounce(TotalPastaKills); // check for a weapon upgrade SetWeaponUpgrade(); }