private void Awake() { // Setting up references. m_GroundCheck = transform.Find("GroundCheck"); m_CeilingCheck = transform.Find("CeilingCheck"); m_Anim = GetComponent <Animator>(); m_Rigidbody2D = GetComponent <Rigidbody2D>(); activeUpgradeTable = new Dictionary <string, bool>(); activeUpgradeTable.Clear(); weaponList = new List <string>(); AddWeapon("BasicBeam"); if (GameObject.FindGameObjectWithTag("HealthUI")) { bar = GameObject.FindGameObjectWithTag("HealthUI"); } GameObject.FindGameObjectWithTag("BulletUI").GetComponent <Image>().color = new Vector4(1, 1, 1, 1); spriteR = gameObject.GetComponent <SpriteRenderer>(); StartCoroutine(LateStart(0.1f)); currentWeapon = (Weapon)transform.Find("Weapon").gameObject.GetComponent(typeof(Weapon)); grappleBeam = gameObject.GetComponent <GrappleBeam>(); if (m_backSphere != null) { m_backSphere.GetComponent <SpriteRenderer>().flipX = spriteR.flipX; } UpdateHealthBar(); }
// Use this for initialization void Start() { shipHull = GetComponent<Rigidbody> (); grapple = transform.GetChild (0).GetComponent<GrappleBeam> (); }