using UnityEngine;
using System.Collections;

public class Seen : MonoBehaviour {
	public ThirdPersonController ThirdPersonController;
	public ThirdPersonCamera ThirdPersonCamera;
	public int time = 1000;
	public bool ticking = false; 
	public GameObject character;


	// Use this for initialization
	void Start () {
	
	}


	void Awake(){

		ThirdPersonController = GameObject.Find("Player").GetComponent<ThirdPersonController>();
		ThirdPersonCamera = GameObject.Find("Player").GetComponent<ThirdPersonCamera>();
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	void FixedUpdate(){

		if(time >=1){

			if(ticking){
				time--;

			}
		}
		else if(time == 0){
			ticking = false;
			ThirdPersonController.walkSpeed -=7.0F;
			ThirdPersonController.runSpeed -=14.0F;
			ThirdPersonController.jumpHeight /= 3;
			character.transform.localScale /= 3;
			character.transform.Translate(3,3,3);
			ThirdPersonCamera.distance = 7.0F;
			time = 1000;
			gameObject.transform.Translate(+10,+10,+10);
		}

	}
	void OnTriggerEnter(Collider other){
		ThirdPersonController.walkSpeed +=7.0F;
		ThirdPersonController.runSpeed +=14.0F;
		ThirdPersonController.jumpHeight *= 3;
		character =  other.gameObject;
		other.transform.localScale *= 3;
		other.transform.Translate(3,3,3);
		ThirdPersonCamera.distance = 14.0F;
		gameObject.transform.Translate(-10,-10,-10);

		ticking = true;

	}


}
