Class used to allow GameObject.AddComponent / GameObject.GetComponent to be used.

Inheritance: ParticleEmitter
Exemple #1
0
    void OnCollisionEnter(Collision coll)
    {
        if (active) {
            return;
        }
        active = true;
        hits++;
        Debug.Log (coll.collider.gameObject);
        GameObject.Destroy (coll.collider.gameObject);

        GameObject boom = CannonFire.expl;
        //Debug.Log ("Test");

        sfxPlayer.PlayOneShot(sfxHit);

        boomIns = (GameObject) Instantiate (boom, coll.contacts[0].point, Quaternion.identity);
        //Debug.Log (coll.collider.gameObject.name);

        emi = boomIns.gameObject.GetComponent<EllipsoidParticleEmitter> ();
        emi.maxSize = 5;

        if (hits >= 3)
        {
            musicPlayer.clip = pirateMusicWin;
            musicPlayer.Play();
        }
    }
	// Use this for initialization
	void Start () {
		ConsoleLog.SLog ("PlayerGameManager Start()");

		anim = GetComponent<Animator> ();
		cardboardCamera = GameObject.FindGameObjectWithTag("PlayerHead");
		cardboardHead = cardboardCamera.GetComponent<CardboardHead> ();
		headPos = GameObject.FindGameObjectWithTag ("CameraPos").transform;
		gun = GameObject.FindGameObjectWithTag ("MyGun");
		gunProperties = gun.GetComponent<GunProperties> ();
		gunAudio = gun.GetComponents<AudioSource> ();
		gunLight = GameObject.FindGameObjectWithTag ("GunLight");
		gunFlashEmitter = GameObject.FindGameObjectWithTag ("GunFlash").GetComponent<EllipsoidParticleEmitter>();
		gunFlashEmitter.emit = false;
		footstepsAudio = GetComponent<AudioSource> ();
		bulletHoleArray = new ArrayList (bulletHoleMaxAmount);

		//HUD
		HUD = GameObject.FindGameObjectWithTag("HUD");
		healthBar = HUD.transform.GetChild (0) as Transform;
		bulletText = HUD.transform.GetChild (1).GetComponent<TextMesh>();
		reloadText = HUD.transform.GetChild (2).GetComponent<TextMesh>();
		grenadeText = HUD.transform.GetChild (3).GetComponent<TextMesh>();
		HUDCanvas = HUD.transform.GetChild (4).gameObject;
		deadText = HUDCanvas.transform.GetChild (0).gameObject;
		endRoundText = HUDCanvas.transform.GetChild (1).gameObject;
		endGameText = HUDCanvas.transform.GetChild (2).gameObject;

		bulletText.text = gunProperties.bulletLoadCurrent + "/" + gunProperties.bulletStoreCurrent;
		grenadeText.text = grenadeStore + "";
	}
 public void StopEffect(EllipsoidParticleEmitter effect)
 {
     Debug.Log("stopping effect");
     effect.emit = false;
 }
 public void StartEffect(EllipsoidParticleEmitter effect)
 {
     Debug.Log("starting effect");
     effect.emit = true;
 }
Exemple #5
0
 // Use this for initialization
 void Start()
 {
     tPlayerPos = GameObject.FindGameObjectWithTag("Player").transform;
     emitter = gameObject.GetComponent<EllipsoidParticleEmitter>();
 }