private void ReleaseSuiciders() { Dude.SetBobyPartsKinematic(true); DudeAnimator.SetupPivots(); int total = GGHeroGame.GetTotal(); int totalBefore = total + GameSettings.SuiRescuedCount; GameSettings.SuiRescuedCount += GetHoldingSuis(); int totalAfter = total + GameSettings.SuiRescuedCount; m_gameplay.ReportAchievementIfNeeded(totalBefore, totalAfter); Vector2 rescuePosition = transform.position.x < 0.0f ? m_rescuePointLeft.position : m_rescuePointRight.position; while (m_suiciders.Count > 0) { Suicider sui = m_suiciders.Pop(); ShowSurvivalName(sui); sui.Dude.PlugOut(); sui.SetController(new SuiControllerRescuing(sui, rescuePosition)); } }
private void AddSui(Suicider sui) { GrabEffect grabEffect = m_grabEffectPool.Get(); if (grabEffect != null) { grabEffect.transform.position = sui.transform.position; grabEffect.Play(); } sui.IsKinematic = false; sui.Dude.SetBobyPartsKinematic(false); sui.DudeAnimator.ClearClip(); sui.Dude.PlugIn(Dude); sui.SetController(new SuiControllerWithSuperhero(sui)); if (m_suiciders.Count > 0) { Dude dude = m_suiciders.Peek().Dude; dude.PlugOut(); dude.PlugIn(sui.Dude); } m_suiciders.Push(sui); }
private void JumpRandomSui() { Suicider sui = GetRandomWalkingSuiInsideJumpArea(); if (sui == null) { return; } sui.SetController(new SuiControllerPreparingForJump(sui)); }
private void GenerateSuicider(float xCoord, float direction) { Vector3 initialPosition = new Vector3(xCoord, BridgeHeight, 0.0f); SuiciderRoot suiciderRoot = m_suiciderPool.Get(); if (suiciderRoot == null) { return; } suiciderRoot.transform.position = initialPosition; Suicider suicider = suiciderRoot.Suicider; suicider.TintColor = ColorPalette.GetRandomColor(); suicider.SkinTintColor = ColorPalette.GetRandomSkinColor(); suicider.Initialize(m_waterLevel); suicider.SortOrder = 21; suicider.SetIsFemale(Random.value > 0.5f); suicider.SetController(new SuiControllerWalkOnBridge(suicider, initialPosition, direction, m_bridgeWalkArea)); suicider.Reset(); }