using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DildoGift : MonoBehaviour {

	public bool triggered = false;
	private bool xxx = false;
	GameController gc;
//	PlayerController plc;

	Animator anim;

	void Start () {
		anim = GetComponent<Animator> ();
		GameObject canvass = GameObject.Find ("Canvas");
		gc = canvass.GetComponent<GameController> ();
	}
	
	void Update () {
		if (triggered)
			anim.SetBool ("SeekForPrey", true);
	}

	Collider2D col = null;
	void OnTriggerStay2D(Collider2D col){
		if (triggered) {
			this.col = col;
			Invoke ("dosth", .5f);
		}
	}

	void dosth(){
		col.gameObject.GetComponent<PlayerController> ().playable = false;
		gc.RestaVida ();
	}
}
