// Start is called before the first frame update void Start() { solarFighter = GameObject.FindGameObjectWithTag("Player"); Physics2D.IgnoreCollision(solarFighter.GetComponent <Collider2D>(), GetComponent <Collider2D>()); solarFighterHP = solarFighter.GetComponent <Common_HP>(); curShieldHealCD = shieldHealCD; }
// Start is called before the first frame update void Start() { solarFighter = GameObject.FindGameObjectWithTag("Player"); solarFighterHP = solarFighter.GetComponent <Common_HP>(); solarFighterWeapon = solarFighter.GetComponent <Player_SolarWeaponControl>(); Physics2D.IgnoreCollision(GetComponent <Collider2D>(), solarFighter.GetComponent <Collider2D>()); solarFighterHP.isInvicible = true; solarFighterWeapon.isShieldActived = true; }
// Start is called before the first frame update void Start() { nebulaFighterHP = GameObject.FindGameObjectWithTag("Player").GetComponent <Common_HP>(); snipeBulletData = snipeBullet.GetComponent <Common_Bullet>(); weaponLevel = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_NebulaWeaponControl>().baseBulletLevel; isSnipeActived = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_NebulaWeaponControl>().isSnipeActived; playerSoundManager = GameObject.FindGameObjectWithTag("PlayerSound").GetComponent <SE_PlayerSoundManager>(); }
// Start is called before the first frame update void Start() { nebulaFighterHP = GameObject.FindGameObjectWithTag("Player").GetComponent <Common_HP>(); weaponData = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_BaseWeaponControl>(); curLevel = weaponData.baseBulletLevel; spData = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_SpecialAbilityActivation>(); isSPActived = spData.getIsActivated(); // Load fire sound fireSound = GameObject.Find("NebulaSnipe").GetComponent <AudioSource>(); }
private void OnCollisionStay2D(Collision2D collision) { if (collision.gameObject.tag != "Bullet" && collision.gameObject.tag == targetList[crashalbeTarget]) { crashTargetHP = collision.gameObject.GetComponent <Common_HP>(); if (!crashTargetHP.isInvicible) { crashTargetHP.damage(crashDamage); } } else { Physics2D.IgnoreCollision(collision.gameObject.GetComponent <Collider2D>(), GetComponent <Collider2D>()); } }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == targetList[target]) { GameObject hitTarget = collision.gameObject; targetHP = hitTarget.GetComponent <Common_HP>(); if (!targetHP.isInvicible) { targetHP.damage(atk); } if (!isPiercing) { Destroy(gameObject); } } }
// Start is called before the first frame update void Start() { // Preparing for entering animation player = GetComponent <Rigidbody2D>(); isAllowMoving = false; shield = GameObject.Find("Player_InvincibleShield"); playerWeapon = GetComponent <Player_BaseWeaponControl>(); playerWeapon.isFireAllowed = false; playerSP = GetComponent <Player_SpecialAbilityActivation>(); playerSP.isSPAllowed = false; playerHP = GetComponent <Common_HP>(); playerHP.isInvicible = true; initPos = transform.position; healthBar = GameObject.FindGameObjectWithTag("StatusBar/HP").GetComponent <Player_UI_HealthBarControl>(); healthBar.setInOpt(false); skillBar = GameObject.FindGameObjectWithTag("StatusBar/SP").GetComponent <Player_UI_SkillBarControl>(); skillBar.setInOpt(false); pasueMenu = GameObject.FindGameObjectWithTag("GameManager").GetComponent <UI_GamePasue>(); pasueMenu.isAvaliable = false; Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Player"); playerHP = player.GetComponent <Common_HP>(); turretSet = GetComponent <Rigidbody2D>(); }
// Start is called before the first frame update void Start() { weaponData = GetComponent <Player_BaseWeaponControl>(); spData = GetComponent <Player_SpecialAbilityActivation>(); hpData = GetComponent <Common_HP>(); }