IEnumerator FadeIn() { float t = 0.0f; initialTransform.Reset(transform); while (t <= 1.0f) { t += Time.deltaTime; Color color = spriteRenderer.color; color.a = t * MAX_ALPHA; spriteRenderer.color = color; yield return(null); } }
public virtual void ResetForRebirth() { DisableRagdoll(); hitFlasher.ResetFlashColor(); skeletonRootMemento.Reset(skeletonRoot.transform, transform); ToggleColliders(true); myStats.ResetForRebirth(); controller.ResetForRebirth(); velBody.ResetForRebirth(); will.Reset(); transform.SetParent(poolParent); transform.localScale = transformMemento.startScale; lastChance = false; isStunFlashing = false; alreadyStunned = false; isIndestructable = false; landingMarker.SetActive(true); }
public void DisableRagdoll() { if (JointRigidBodies != null) { //Ignore the first entry (its the self rigidbody) for (int i = 1; i < JointRigidBodies.Length; i++) { //RagdollHandler ragdollHandler = jointRigidBodies[i].GetComponent<RagdollHandler>(); //if (ragdollHandler) //{ // ragdollHandler.ResetBone(); //} JointRigidBodies[i].useGravity = false; JointRigidBodies[i].velocity = Vector3.zero; JointRigidBodies[i].angularVelocity = Vector3.zero; JointRigidBodies[i].angularDrag = 0.05f; JointRigidBodies[i].isKinematic = true; if (rigidBodyMasses != null) { JointRigidBodies[i].mass = rigidBodyMasses[i]; } } } //Reset skeleton if (skeletonRoot) { for (int i = 0; i < skeletonTransforms.Length; i++) { skeletonTransformMomentos[i].Reset(skeletonTransforms[i]); } } if (grabObject) { grabObject.transform.parent = transform; grabObjectMomento.Reset(grabObject.transform); } ragdollOn = false; }
public void ResetTransform() { savedConfiguration.Reset(transform); }