var GunNormal : Transform;
var GunAiming : Transform;
var GunRunning : Transform;
var GunJumping : Transform;

public var OrigPosGunNormal : Vector3 = Vector3.zero;
public var OrigRotGunNormal : Quaternion = Quaternion.identity;

public var OrigPosGunAiming : Vector3 = Vector3.zero;
public var OrigRotGunAiming : Quaternion = Quaternion.identity;

public var OrigPosGunRunning : Vector3 = Vector3.zero;
public var OrigRotGunRunning : Quaternion = Quaternion.identity;

public var OrigPosGunJumping : Vector3 = Vector3.zero;
public var OrigRotGunJumping : Quaternion = Quaternion.identity;

function Start () {
	if(GunNormal != null){
		OrigPosGunNormal = GunNormal.localPosition;
		OrigRotGunNormal = GunNormal.localRotation;
		OrigPosGunRunning = GunNormal.localPosition;
		OrigRotGunRunning = GunNormal.localRotation;
		OrigPosGunJumping = GunNormal.localPosition;
		OrigRotGunJumping = GunNormal.localRotation;
	}
	
	if(GunAiming != null){
		OrigPosGunAiming = GunAiming.localPosition;
		OrigRotGunAiming = GunAiming.localRotation;
	}

	if(GunRunning != null){
		OrigPosGunRunning = GunRunning.localPosition;
		OrigRotGunRunning = GunRunning.localRotation;
	}
	
	if(GunJumping != null){
		OrigPosGunJumping = GunJumping.localPosition;
		OrigRotGunJumping = GunJumping.localRotation;
	}
}


function Update() {
	if(FPCStatus.IsJumping && !FPCStatus.IsJumpingAntFrame){
		this.gameObject.SendMessage("ReasignOriginalValues", OrigPosGunJumping);
		this.gameObject.SendMessage("ReasignOriginalRotValues", OrigRotGunJumping);
	}
	else
	if(!FPCStatus.IsJumping && FPCStatus.IsJumpingAntFrame && !FPCStatus.IsAiming){
		if(FPCStatus.isRunning){
			this.gameObject.SendMessage("ReasignOriginalValues", OrigPosGunRunning);
			this.gameObject.SendMessage("ReasignOriginalRotValues", OrigRotGunRunning);
		}
		else
		if(FPCStatus.isNormal){
			this.gameObject.SendMessage("ReasignOriginalValues", OrigPosGunNormal);
			this.gameObject.SendMessage("ReasignOriginalRotValues", OrigRotGunNormal);
		}
	}
	else
	if(FPCStatus.isRunning && !FPCStatus.isRunningAntFrame){
		this.gameObject.SendMessage("ReasignOriginalValues", OrigPosGunRunning);
		this.gameObject.SendMessage("ReasignOriginalRotValues", OrigRotGunRunning);
	}
	else
	if(FPCStatus.isNormal && !FPCStatus.isNormalAntFrame && !FPCStatus.IsAiming){
		this.gameObject.SendMessage("ReasignOriginalValues", OrigPosGunNormal);
		this.gameObject.SendMessage("ReasignOriginalRotValues", OrigRotGunNormal);
	}
	
	FPCStatus.isRunningAntFrame = FPCStatus.isRunning;
	FPCStatus.IsJumpingAntFrame = FPCStatus.IsJumping;
}		