예제 #1
0
    IEnumerator StartAutodestruction()
    {
        yield return(new WaitForSeconds(Papierek_Manager_Script.instance().papierekLifeSpan));

        if (destroy)
        {
            Destroy(gameObject);
        }
    }
예제 #2
0
	void OnMouseDown()
	{
		//Destroy(gameObject);
		//StopCoroutine (StartAutodestruction ());
		destroy = false;
		gameObject.GetComponent<SpriteRenderer> ().color = Color.gray;
		Papierek_Manager_Script pm=Papierek_Manager_Script.instance ();
		pm.papierkiCount++;
		GameManager.Instance.AddScore (50f);
	}
예제 #3
0
    void OnMouseDown()
    {
        //Destroy(gameObject);
        destroy = false;
        //StopCoroutine (StartAutodestruction ());
        Papierek_Manager_Script pm = Papierek_Manager_Script.instance();

        pm.papierkiCount++;
        pm.lifesLeft = pm.lifesLeft - 1;
        Instantiate(kaczka);
        GameManager.Instance.AddScore(-100f);
    }
예제 #4
0
	IEnumerator StartAutodestruction()
	{
		yield return new WaitForSeconds (Papierek_Manager_Script.instance ().papierekLifeSpan);
			if (destroy) 
				{
					GameObject tmp;


			tmp =(GameObject)Instantiate(krzyz);
			//tmp.transform.parent=gameObject.transform;
			tmp.transform.position=new Vector2(gameObject.transform.position.x+55,gameObject.transform.position.y+30);
			Instantiate(kaczka);
			yield return new WaitForSeconds(0.1f);
					
					--Papierek_Manager_Script.instance ().lifesLeft;
					Destroy (gameObject);
					Destroy (tmp);
					
				}

	}