Exemplo n.º 1
0
    public void FleakCollided(string s)
    {
        if (parent != null)
        {
            parent.GetComponent <Spawn> ().full = false;
        }
        spawns.full--;
        particle      = PoolingSystem.Instance.InstantiateAPS("prtclFrtHit", transform.position);
        particleSplsh = particle.transform.GetChild(0).gameObject;
        particle.particleSystem.renderer.sortingLayerName      = "UI";
        particleSplsh.particleSystem.renderer.sortingLayerName = "UI";
        //particle.particleSystem.startColor = RandomColor (frtHit1, frtHit2);
        //particleSplsh.particleSystem.startColor = RandomColor(frtHitSplash1, frtHitSplash2);
        //string a = s;
        string b = string.Empty;

        for (int i = 0; i < s.Length; i++)
        {
            if (char.IsDigit(s [i]))
            {
                b += s [i];
            }
            if (b.Length > 0)
            {
                val = int.Parse(b);
            }
        }
        particle.particleSystem.startColor      = controller.scoretext[val - 1].color;
        particleSplsh.particleSystem.startColor = controller.splshC[val - 1];
        AddScore(s);
        FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/flea_pointcollect", camPos);
        spawns.removeFruit(this.gameObject);
        PoolingSystem.DestroyAPS(this.gameObject);
    }
Exemplo n.º 2
0
 public void DestroyFleaInstant(GameObject obj)
 {
     if (clone != null)
     {
         PoolingSystem.DestroyAPS(obj);
     }
     bullets -= 1;
     Cooldown();
 }
Exemplo n.º 3
0
	void OnTriggerEnter(Collider other){
		if (!other.name.Contains ("Game")) {
			if (other.gameObject.tag.Contains ("Player")) {
				AddScore (other.name);
				FMOD_StudioSystem.instance.PlayOneShot ("event:/01_sfx/flea_pointcollect", transform.position);
				spawns.removeFruit (this.gameObject);
				PoolingSystem.DestroyAPS (this.gameObject);
				PoolingSystem.DestroyAPS (other.gameObject);
			} 
		}
	}
Exemplo n.º 4
0
 public void FruitSwallow(int amount, Collider other)
 {
     if (other.gameObject.GetComponent <Fruit> ())
     {
         eaten.Add(other.gameObject);
         other.gameObject.GetComponent <Fruit> ().dragged = false;
         pot = pot + amount;
         checkPot();
         PoolingSystem.DestroyAPS(other.gameObject);
     }
 }
Exemplo n.º 5
0
    public IEnumerator DestroyFlea(float time)
    {
        for (float timer = time; timer >= 0; timer -= Time.deltaTime)
        {
            yield return(null);
        }
        //yield return null;
        FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/flea_poof", transform.position);

        PoolingSystem.DestroyAPS(this.gameObject);
        DecreaseBullets();
        yield return(null);
    }
Exemplo n.º 6
0
    void OnTriggerEnter(Collider other)
    {
        if (!other.name.Contains("Game"))
        {
            if (other.name.Contains("Fleak"))
            {
                if (hits > maxhits)
                {
                    if (parent != null)
                    {
                        parent.GetComponent <Spawn> ().full = false;
                    }
                    spawns.full--;

                    parseIntfromString(other.name);
                    setParticlesbrkn();

                    //particle.particleSystem.startColor = RandomColor (frtHit1, frtHit2);
                    //particleSplsh.particleSystem.startColor = RandomColor(frtHitSplash1, frtHitSplash2);
                    AddScore(other.name);
                    FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/flea_coconut", GameObject.Find("Main Camera").transform.position);
                    other.gameObject.GetComponent <Bullet>().DecreaseBullets();
                    PoolingSystem.DestroyAPS(other.gameObject);
                    PoolingSystem.DestroyAPS(this.gameObject);
                }
                else
                {
                    parseIntfromString(other.name);
                    setParticles();
                    //particle.particleSystem.startColor = RandomColor (frtHit1, frtHit2);
                    other.rigidbody.AddForce(0, bounce, 0, ForceMode.Impulse);                       // make the object bounce away
                    other.collider.enabled = false;
                    FMOD_StudioSystem.instance.PlayOneShot("event:/01_sfx/flea_coconut_break", camPos);
                    //if(Application.loadedLevelName.Contains ("7")){
                    clone = poolingSystem.InstantiateAPS("frtCoconasBrkn", transform.position, transform.rotation, parent);
                    clone.GetComponent <Coconut>().parent = parent;
                    //}
                    //else poolingSystem.InstantiateAPS ("frtCoconasBrkn", transform.position, transform.rotation);
                    PoolingSystem.DestroyAPS(this.gameObject);
                }
            }
        }
    }
Exemplo n.º 7
0
 public static void DestroyAPS(this GameObject myobject)
 {
     PoolingSystem.DestroyAPS(myobject);
 }
Exemplo n.º 8
0
 public void removeFruit(GameObject go)
 {
     fruits.Remove(go);
     PoolingSystem.DestroyAPS(go);
 }
Exemplo n.º 9
0
 public void finishSplosion()
 {
     PoolingSystem.DestroyAPS(this.gameObject);
 }
Exemplo n.º 10
0
 public void rmFirstFleak()
 {
     PoolingSystem.DestroyAPS(clone);
     launchpad.renderer.material.SetColor("_Color", Color.Lerp(orig, Color.black, 0.5f));
 }