Exemplo n.º 1
0
	// Use this for initialization
	void Start () {
		if(transform.parent.GetComponent<Fire>() != null){
			fire = transform.parent.GetComponent<Fire>();
			endPoint = fire.getArea();
		}
		if(dir == Compass.east){
			endPoint = (int)Mathf.Round(transform.position.x) + endPoint;
			nextFx = (int)Mathf.Round(transform.position.x) + 1;
			pos = new Vector3(speed,0,0);
		}else if(dir == Compass.north){
			endPoint = (int)Mathf.Round(transform.position.z) + endPoint;
			nextFx = (int)Mathf.Round(transform.position.z) + 1;
			pos = new Vector3(0,0,speed);
		}else if(dir == Compass.south){
			endPoint = (int)Mathf.Round(transform.position.z) - endPoint;
			nextFx = (int)Mathf.Round(transform.position.z) - 1;
			pos = new Vector3(0,0,-speed);
		}else if(dir == Compass.west){
			endPoint = (int)Mathf.Round(transform.position.x) - endPoint;
			nextFx = (int)Mathf.Round(transform.position.x) - 1;
			pos = new Vector3(-speed,0,0);
		}
	}