protected override void Start() { base.Start(); rayLength = skinWidth * 2; livingEntity = GetComponentInParent <LivingEntity>(); animCtrl = livingEntity.GetComponent <AnimController2D>(); controller = livingEntity.GetComponent <Controller2D>(); }
//AnimationClip m_nowPlaying = null; // Use this for initialization void Start () { controller = GetComponent<Controller2D> (); //m_anim = GetComponent<SpriteAnim> (); m_animController = GetComponent<AnimController2D> (); gravity = (-2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2); maxJumpVelocity = (Mathf.Abs(gravity) * timeToJumpApex); minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight); print ("Gravity: " + gravity + " Jump Velocity: " + maxJumpVelocity); }
protected override void Start() { base.Start(); animControl = GetComponent <AnimController2D>(); controller = GetComponent <Controller2D>(); if (equippedWeapon) { equippedWeapon.enabled = false; } gravity = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2); jumpVelocity = Mathf.Abs(gravity) * timeToJumpApex; }