コード例 #1
0
	void OnTriggerEnter(Collider col) {
		if(col.gameObject.tag == "Converser")
		{
			// Trigger if the collider is not orbiting.
			OrbReaction reaction = col.gameObject.GetComponent<OrbReaction>();
			if (reaction != null && reaction.StartTrip())
			{
				feedback = col.gameObject.GetComponent<Feedback>();
				feedback.AlternateTrail();
				largeExplosion = (GameObject)Instantiate(largeExplosionPrefab);
				largeExplosion.transform.position = col.transform.position;

				Destroy(gameObject);
			}
		}
	}
コード例 #2
0
    void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.tag == "Converser")
        {
            // Trigger if the collider is not orbiting.
            OrbReaction reaction = col.gameObject.GetComponent <OrbReaction>();
            if (reaction != null && reaction.StartTrip())
            {
                feedback = col.gameObject.GetComponent <Feedback>();
                feedback.AlternateTrail();
                largeExplosion = (GameObject)Instantiate(largeExplosionPrefab);
                largeExplosion.transform.position = col.transform.position;

                Destroy(gameObject);
            }
        }
    }