private void UpdateStatus(IKStatus to) { if (IKStatus == to) { return; } IKStatus = to; TransformHelper.ChangeLayers(armIK.transform, (IKStatus == IKStatus.lockedIK) ? "Default" : armLayer); armIK.transform.SetParent((IKStatus == IKStatus.lockedIK) ? lockedIKParent : this.transform); }
public void Initialize(Rigidbody body, float addForce, UnityAction <Vector3, Vector3> impactCall) { Unpool(); rigidbody = body; onImpact = impactCall; tr = GetComponentInChildren <TrailRenderer>(); additiveForce = addForce; StartCoroutine(changeLayer()); IEnumerator changeLayer() { TransformHelper.ChangeLayers(this.transform, "Overlay"); yield return(new WaitForSeconds(0.1f)); TransformHelper.ChangeLayers(this.transform, "Default"); } }