public void DoThrow() { Axe.parent = null; AxeState = AxeStates.AxeOut; AxeControl.SetThrowParams(Quaternion.AngleAxis(ThrowAngle + AimAngleOffset, transform.right) * transform.forward * ThrowForce); anim_control.SetThrowParams(); }
void Arrival() { anim.SetTrigger("Arrival"); SetParent("hand"); current_axe_state = AxeStates.in_hand; central_command.ReceiveAxe(); }
public void ReturnOrder(Transform target) { AxeState = AxeStates.Called; HandTarget = target; to_hand_direction = HandTarget.position - transform.position; lateral_hand_direction = Quaternion.AngleAxis(90f, Vector3.up) * to_hand_direction; curve_eval = 0f; initial_sqr_dist = Vector3.SqrMagnitude(to_hand_direction); }
public void Recall() { if (current_axe_state != AxeStates.in_hand) { current_axe_state = AxeStates.recalled; anim.SetTrigger("Return"); recall_target = HandHolder.transform.position; } }
public void SetAxeState(string msg) { if (msg == "hand") { AxeState = AxeStates.InHand; } else { AxeState = AxeStates.InHolder; } UpdateAxeState(); }
public void ChangeWeaponState() { if (AxeState == AxeStates.InHand) { AxeState = AxeStates.InHolder; } else if (AxeState == AxeStates.InHolder) { AxeState = AxeStates.InHand; } UpdateAxeState(); }
public void Throw(Vector3 v) { Vector3 direction = v; transform.parent = null; rb.isKinematic = false; rb.velocity += direction * ThrowVelocity; current_axe_state = AxeStates.thrown; anim.SetTrigger("Shoot"); Active = true; }
public void ChangeParent(string target) { if (target == "kratos") { if (current_axe_state == AxeStates.in_hand) { current_axe_state = AxeStates.in_back; } else { current_axe_state = AxeStates.in_hand; } MoveToParent(); } }
void OnTriggerEnter(Collider other) { if (IsThrown() || IsRecalled()) { if (other.gameObject.transform.root != HandHolder.transform.root) { rb.isKinematic = true; anim.SetTrigger("AxeImpact"); CreateExplosion(); Active = false; current_axe_state = AxeStates.stuck; } } }
void Start() { AxeState = AxeStates.Held; RotationAxis = RotationAxis.normalized; // kinematic_controller = GetComponent<CharacterController>(); }
public void AcknowledgeReturn() { AxeState = AxeStates.Held; }
// CharacterController kinematic_controller; public void SetThrowParams(Vector3 v) { ThrowDirection = v; AxeState = AxeStates.Thrown; }
public void ReceiveAxe() { AxeState = AxeStates.InHand; UpdateAxeState(); }
void SetParent(string parent) { current_axe_state = parent == "hand" ? AxeStates.in_hand : AxeStates.in_back; MoveToParent(); }