private void SpawnHusk() { if (m_husk_prefab != null) { GameObject husk = HamsterBallSimulator.Get().SpawnGameObject(m_husk_prefab, transform.position, transform.rotation); // Inherit physics properties Rigidbody my_rb = GetComponent <Rigidbody>(); if (my_rb != null) { Vector3 velocity = my_rb.velocity; Vector3 angularVelocity = my_rb.angularVelocity; foreach (var rb in GetComponentsInChildren <Rigidbody>()) { rb.velocity = velocity; rb.angularVelocity = angularVelocity; } } // Explode if (m_explode_on_destroy) { Explode(husk); } } }
private void UpdateFreeRoam() { if (m_FreeRoamTimer.Elapsed()) { m_FreeRoamTimer.Invalidate(); NarrativeAudioManager.Get().PlayLine(m_OwnerComesHomeLine); // Let Karen roam free m_Karen.SetActive(true); HamsterBallSimulator.Get().AddGameObjectToMainPhysicsSim(m_Karen); ChangeState(EGameState.KAREN_CHASE); } }