void Start () { controller = GetComponent<Player2D> (); gravity = -(2 * jumpHeight) / Mathf.Pow (timeToJumpApex, 2); jumpVelocity = Mathf.Abs (gravity) * timeToJumpApex; print ("Gravity:" + gravity + " Jump Velocity" + jumpVelocity); }
void Awake() { playerData2D = GameObject.FindWithTag("Player2D").GetComponent<PlayerData2D>(); player2D = GameObject.FindWithTag("Player2D").GetComponent<Player2D>(); lifes2D = gameObject.GetComponent<Lifes2D>(); scoreUpAnim = gameObject.GetComponent<ScoreUpAnim>(); comboText2D = GameObject.Find("Combo2D").GetComponent<Text>(); comboText3D = GameObject.Find("Combo3D").GetComponent<Text>(); ComboDraw (); }
// Use this for initialization void Start () { player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player2D>(); barHP = transform.FindChild("Bar_HP").Find("Fill").GetComponent<Image>(); }
private void Awake() { character = GetComponent<Player2D>(); }
// Debug (For testing only) void Start () { cam = Camera.main; playerScript = player.GetComponent<Player2D>(); RequestScoreCheckpoints (); }