コード例 #1
0
 void Start()
 {
     myController  = GetComponent <PlayerController>();
     rollingScript = GetComponent <PlayerRolling>();
     anim          = transform.GetChild(0).GetChild(0).GetComponent <Animator>();
     legsAnim      = transform.GetChild(0).GetChild(0).GetChild(0).GetComponent <Animator>();
 }
コード例 #2
0
    void Start()
    {
        flipTransform = transform.GetChild(0);
        anim          = flipTransform.GetChild(0).GetComponent <Animator>();
        legsAnim      = flipTransform.GetChild(0).GetChild(0).GetComponent <Animator>();
        upperSr       = flipTransform.GetChild(0).GetComponent <SpriteRenderer>();
        lowerSr       = flipTransform.GetChild(0).GetChild(0).GetComponent <SpriteRenderer>();
        defaultColor  = upperSr.color;

        genericController = GetComponent <CollisionsController>();
        myController      = GetComponent <PlayerController>();
        rollingScript     = GetComponent <PlayerRolling>();

        //kinematics
        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);
    }
コード例 #3
0
 void Start()
 {
     player        = GetComponent <Player>();
     playerRolling = GetComponent <PlayerRolling>();
     myRigidbody   = GetComponent <Rigidbody>();
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     player       = GetComponent <Player>();
     rollScript   = GetComponent <PlayerRolling>();
     attackScript = GetComponent <PlayerSwordAttack>();
 }
コード例 #5
0
 void Start()
 {
     player        = GetComponent <Player>();
     playerRolling = GetComponent <PlayerRolling>();
 }