public void setup(PlayerAction3 act) { colliders = act.GetComponents <CapsuleCollider>(); rbDefaultConstraints = act.rb.constraints; }
public void init(PlayerAction3 act) { scaleRate = Mathf.Max(act.tf.localScale.y, act.tf.localScale.z); scaleRateR = 1.0f / scaleRate; groundHookReach = bodyRadius * 1.0f; //act.def.groundHookReachRate; }
public void walk(PlayerAction3 act) { if (GamePad._l3) { act.state.changeTo(act.crawl); } else { if (GamePad._l1 && act.grounder.isGround) { //if( ls.sqrmag > 0.6f * 0.6f ) if (ls.sqrmag > 0.1f * 0.1f) { if (act.checkOverBarrier()) { act.state.changeTo(act.overBarrier); } else { //move.setSpeedRate( 2.0f ); act.state.changeTo(act.avoidance); } } /*else if( ls.sqrmag < 0.1f * 0.1f ) * { * changeToJumpMode( 200.0f ); * } */ } else if (!dashButton.over(true) && GamePad.l1_ && act.grounder.isGround) // { // act.changeToJumpMode(200.0f); // } // else if (!act.grounder.isGround) { act.changeToFallMode(); } } /*if( GamePad._l2 ) * { * * state.changeTo( wire ); * * }*/ }
public void deepInitFromAction(PlayerAction3 action) { act = action; //GetComponentInParent<PlayerAction3>(); tf = transform; cam = GetComponent <Camera>(); standardFov = cam.fieldOfView; fovRatio = 1.0f; initFpsModeParams(); }
/* * void switchObservedCenter() * {Debug.Log( this.tfObservedCenter.name ); * * var pre = act.tfObservedCenter; * * act.tfObservedCenter = this.tfObservedCenter; * * this.tfObservedCenter = pre; * * } */ public void setup(PlayerAction3 action) { act = action; smr = act.GetComponentInChildren <SkinnedMeshRender>(); setupRigidbodys(smr.bones); tfRagdollBase.parent = null; tfRagdollBase.gameObject.SetActive(false); tfRagdollBase.name = "base"; // msRagdoll = RagdollCliper.createState(act.tfBody.GetComponent <Animation>()); // msRagdoll.blendMode = AnimationBlendMode.Blend; msRagdoll.speed = 0.0f; }