using UnityEngine;
using System.Collections;

public class Powerup : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void OnCollisionEnter(Collision col)
	{
		Debug.Log("POWERUP COLLISION ENTER " + col.gameObject.name);
		if(col.gameObject.tag == "Player")
		{
			Debug.Log("PLAYER HIT POWERUP " + col.gameObject.name);
			if(col.gameObject.GetComponentInChildren<Observer>() != null)
			{
				col.gameObject.GetComponentInChildren<Observer>().gameObject.transform.localScale = col.gameObject.GetComponentInChildren<Observer>().gameObject.transform.localScale*2;
			}
			GetComponent<FadeToTrans>().fadeTime = 0.3f;
			GetComponent<FadeToTrans>().fadeLimit = 99;
		}
		
	}
}
