void Awake() { // Setting up references. //explosionFX = GameObject.FindGameObjectWithTag("ExplosionFX").GetComponent<ParticleSystem>(); if (GameObject.FindGameObjectWithTag("Player")) layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent<LayBombs>(); }
void Awake() { // Setting up references. explosionFX = GameObject.FindGameObjectWithTag("ExplosionFX").GetComponent<ParticleSystem>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent<PickupSpawner>(); layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent<LayBombs>(); }
private Animator anim; // Reference to the Animator component. void Awake() { // Setting up the references. anim = transform.root.gameObject.GetComponent <Animator>(); playerCtrl = transform.root.GetComponent <MihoControll>(); lb = transform.root.GetComponent <LayBombs> (); }
private ParticleSystem explosionFX; // Reference to the particle system of the explosion effect. void Awake() { // Setting up references. explosionFX = GameObject.FindGameObjectWithTag("ExplosionFX").GetComponent <ParticleSystem>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent <PickupSpawner>(); layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent <LayBombs>(); }
private ParticleSystem explosionFX; // 爆炸粒子效果 void Awake() { explosionFX = GameObject.FindGameObjectWithTag("ExplosionFX").GetComponent <ParticleSystem>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent <PickupSpawner>(); layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent <LayBombs>(); //audio = GetComponents<AudioSource>(); }
private ParticleSystem explosionFX; // Reference to the particle system of the explosion effect. void Awake() { // Setting up references. explosionFX = GameObject.FindGameObjectWithTag("ExplosionFX").GetComponent <ParticleSystem>(); if (GameObject.FindGameObjectWithTag("Player")) { layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent <LayBombs>(); } }
void Awake() { pickupSpawner = GameObject.Find("PickupManager").GetComponent <PickupSpawner>(); GameObject obj = GameObject.FindGameObjectWithTag("Player"); if (obj != null) { layBombs = obj.GetComponent <LayBombs>(); } }
void Awake() { // Setting up references. FacingRight = true; groundCheck = transform.Find("groundCheck"); anim = GetComponent <Animator>(); rigidbody2d = GetComponent <Rigidbody2D> (); _gun = GetComponentInChildren <Gun> (true); _layBombs = GetComponent <LayBombs> (); Health = GetComponent <PlayerHealth> (); }
private AudioSource audiosource; //播放器 void Awake() { // Setting up references. explosionFX = GameObject.FindGameObjectWithTag("ExplosionFX").GetComponent <ParticleSystem>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent <PickupSpawner>(); if (GameObject.FindGameObjectWithTag("Player")) { layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent <LayBombs>(); } audiosource = GetComponent <AudioSource>(); //初始化播放器 }
void Awake() { explosionFX = GameObject.FindGameObjectWithTag("ExplosionFx").GetComponent <ParticleSystem>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent <PickupSpawner>(); if (GameObject.FindGameObjectWithTag("Player")) { layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent <LayBombs>(); } }
private PickupSpawner pickupSpawner; // Reference to the PickupSpawner script. void Awake() { // Setting up references. pickupSpawner = GameObject.Find("pickupManager").GetComponent <PickupSpawner>(); if (GameObject.FindGameObjectWithTag("Player")) { layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent <LayBombs>(); } GetComponent <Explosive>().Register(OnExplode); }
static public int get_BombCount(IntPtr l) { try { LayBombs self = (LayBombs)checkSelf(l); pushValue(l, true); pushValue(l, self.BombCount); return(2); } catch (Exception e) { return(error(l, e)); } }
void Awake() { explosionFX = GameObject.FindGameObjectWithTag( "ExplosionFX" ).GetComponent<ParticleSystem>(); pickupSpawner = GameObject.Find("pickupManager").GetComponent<PickupSpawner>(); if (GameObject.FindGameObjectWithTag("Player")) layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent<LayBombs>(); }
static public int set_m_bomb(IntPtr l) { try { LayBombs self = (LayBombs)checkSelf(l); UnityEngine.GameObject v; checkType(l, 2, out v); self.m_bomb = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_BombLaid(IntPtr l) { try { LayBombs self = (LayBombs)checkSelf(l); bool v; checkType(l, 2, out v); self.BombLaid = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_m_bombCount(IntPtr l) { try { LayBombs self = (LayBombs)checkSelf(l); System.Int32 v; checkType(l, 2, out v); self.m_bombCount = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
void OnTriggerEnter2D(Collider2D col) { if (col.tag == "Player") { playerHealth = col.gameObject.GetComponent <PlayerHealth>(); playerBomb = col.gameObject.GetComponent <LayBombs>(); gameObject.transform.localScale = new Vector3(); spawnTime = Time.time + cooldown; AudioSource audioSource = gameObject.GetComponent <AudioSource>(); audioSource.Play(); //print("[" + Time.time + "] New spawn time: " + spawnTime); if (playerHealth.health < lowHealthThreshold) { playerHealth.Heal(healthBonus); powerupText.text = playerHealth.playerName + " received health pickup!"; powerupText.gameObject.SetActive(true); StartCoroutine("DisableObjectOnTimer"); return; } if (playerHealth.health > highHealthThreshold) { playerBomb.bombCount = bombsBonus; powerupText.text = playerHealth.playerName + " received bombs pickup!"; powerupText.gameObject.SetActive(true); StartCoroutine("DisableObjectOnTimer"); return; } int rnd = Random.Range(0, 2); if (rnd == 0) { playerHealth.Heal(healthBonus); powerupText.text = playerHealth.playerName + " received health pickup!"; powerupText.gameObject.SetActive(true); StartCoroutine("DisableObjectOnTimer"); } else { playerBomb.bombCount = bombsBonus; powerupText.text = playerHealth.playerName + " received bombs pickup!"; powerupText.gameObject.SetActive(true); StartCoroutine("DisableObjectOnTimer"); } } }
void OnTriggerEnter2D(Collider2D other) { LayBombs bomb_satchel = other.GetComponent <LayBombs>(); // If a bomb carrier enters the trigger zone... if (bomb_satchel != null) { // ... play the pickup sound effect. AudioSource.PlayClipAtPoint(pickupClip, transform.position); // Increase their number of bombs. ++bomb_satchel.bombCount; // Destroy the crate. Destroy(transform.root.gameObject); } }
void OnTriggerEnter2D(Collider2D _col) { Debug.Log(_col.tag); if (_col.CompareTag("Player")) { AudioSource.PlayClipAtPoint(pickupClip, transform.position); LayBombs _scp = _col.GetComponent <LayBombs> (); if (_scp != null) { _scp.bombCount++; } Destroy(gameObject); } else if (_col.CompareTag("ground") && !bLanded) { bLanded = true; animator.SetTrigger("Land"); Debug.Log(" > Land"); } }
void OnTriggerEnter2D(Collider2D other) { // 炸弹还在半空被接住 if (other.tag == "Player") { GameObject.FindGameObjectWithTag("PickupSpawner").GetComponent <AudioSource>().clip = boom; GameObject.FindGameObjectWithTag("PickupSpawner").GetComponent <AudioSource>().Play(); // 销毁炮弹 Destroy(transform.root.gameObject); pickupSpawner.StartCoroutine(pickupSpawner.DeliverPickup()); } // 掉地上 else if (other.tag == "ground" && !landed) { anim.SetTrigger("Land"); transform.parent = null; gameObject.AddComponent <Rigidbody2D>(); landed = true; } LayBombs lay = other.GetComponent <LayBombs>(); lay.bombCount++; }
// Use this for initialization void Start() { DDNA.Instance.SetLoggingLevel(DeltaDNA.Logger.Level.DEBUG); //Register default handlers for event triggered campaigns. These will be candidates for handling ANY Event-Triggered Campaigns. //Any handlers added to RecordEvent() calls with the .Add method will be evaluated before these default handlers. DDNA.Instance.Settings.DefaultImageMessageHandler = new ImageMessageHandler(DDNA.Instance, imageMessage => { // the image message is already prepared so it will show instantly imageMessage.Show(); }); DDNA.Instance.Settings.DefaultGameParameterHandler = new GameParametersHandler(gameParameters => { // do something with the game parameters myGameParameterHandler(gameParameters); DeltaDNA.Logger.LogInfo("Received game parameters from event trigger: " + gameParameters); }); DDNA.Instance.StartSDK(); MissionStarted(); playerHealth = GameObject.Find("hero").GetComponent <PlayerHealth>(); layBombs = GameObject.Find("hero").GetComponent <LayBombs>(); score = GameObject.Find("Score").GetComponent <Score>(); }
void Awake() { if(GameObject.FindGameObjectWithTag("Player")) layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent<LayBombs>(); }
void Awake() { // Setting up the reference. layBombs = GameObject.FindGameObjectWithTag("Player").GetComponent<LayBombs>(); }