// Use this for initialization void Start() { shieldTrigger = GameObject.Find("Shield Trigger"); shieldTriggerScript = shieldTrigger.GetComponent <ShieldTrigger>(); player = GameObject.Find("Player"); playerSpeechBubbleScript = player.GetComponent <PlayerSpeechBubble>(); }
// Use this for initialization void Start() { player = GameObject.Find("Player"); playerController = player.GetComponent <PlayerController>(); playerSpeechBubble = GameObject.Find("Player SpeechBubble"); playerSpeechBubbleScript = player.GetComponent <PlayerSpeechBubble>(); sprite = GameObject.Find("Ground Shield Sprite"); shieldCanvas = GetComponentInChildren <Canvas>(); shieldSpeechBubble = GameObject.Find("Wall Shield SpeechBubble"); shieldSpeechBubble.SetActive(false); }
void Awake() { // Setting up references. groundCheck = transform.Find("groundCheck"); shotSpawn = transform.Find("shotSpawn"); anim = GetComponentInChildren <Animator>(); rb = GetComponent <Rigidbody2D>(); anim.SetFloat("headbobSpeedMultiplier", headbobSpeedMultiplier); speechBubble = this.GetComponentsInChildren <PlayerSpeechBubble> ()[0]; audioSource = GetComponent <AudioSource> (); healthBarCanvas = GameObject.FindGameObjectWithTag("LifeBar").GetComponent <Canvas>(); startingBulletsInInventory = bulletsInInventory; defaultGravityScale = GetComponent <Rigidbody2D> ().gravityScale; }
public override void Start() { // Animation animator = GetComponentInChildren <Animator>(); // Shield Throw shieldPivot = GameObject.Find("Shield Pivot"); shield = GameObject.Find("Shield"); // Crouch playerColl = GetComponent <BoxCollider2D>(); playerSprite = GameObject.Find("Player Sprite"); // Jump Physics rb = GetComponent <Rigidbody2D>(); gravity = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2); maxJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * maxJumpHeight); minJumpVelocity = Mathf.Sqrt(Mathf.Pow(maxJumpVelocity, 2) + 2 * gravity * (maxJumpHeight - minJumpHeight)); // Speech Bubble playerSpeechBubbleScript = GetComponent <PlayerSpeechBubble>(); }