Пример #1
0
 public void DoThrow()
 {
     Axe.parent = null;
     AxeState   = AxeStates.AxeOut;
     AxeControl.SetThrowParams(Quaternion.AngleAxis(ThrowAngle + AimAngleOffset, transform.right) * transform.forward * ThrowForce);
     anim_control.SetThrowParams();
 }
Пример #2
0
    void Arrival()
    {
        anim.SetTrigger("Arrival");
        SetParent("hand");

        current_axe_state = AxeStates.in_hand;

        central_command.ReceiveAxe();
    }
Пример #3
0
        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);
        }
Пример #4
0
    public void Recall()
    {
        if (current_axe_state != AxeStates.in_hand)
        {
            current_axe_state = AxeStates.recalled;
            anim.SetTrigger("Return");

            recall_target = HandHolder.transform.position;
        }
    }
Пример #5
0
        public void SetAxeState(string msg)
        {
            if (msg == "hand")
            {
                AxeState = AxeStates.InHand;
            }
            else
            {
                AxeState = AxeStates.InHolder;
            }

            UpdateAxeState();
        }
Пример #6
0
        public void ChangeWeaponState()
        {
            if (AxeState == AxeStates.InHand)
            {
                AxeState = AxeStates.InHolder;
            }
            else if (AxeState == AxeStates.InHolder)
            {
                AxeState = AxeStates.InHand;
            }

            UpdateAxeState();
        }
Пример #7
0
    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;
    }
Пример #8
0
 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();
     }
 }
Пример #9
0
    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;
            }
        }
    }
Пример #10
0
 void Start()
 {
     AxeState     = AxeStates.Held;
     RotationAxis = RotationAxis.normalized;
     // kinematic_controller = GetComponent<CharacterController>();
 }
Пример #11
0
 public void AcknowledgeReturn()
 {
     AxeState = AxeStates.Held;
 }
Пример #12
0
        // CharacterController kinematic_controller;


        public void SetThrowParams(Vector3 v)
        {
            ThrowDirection = v;
            AxeState       = AxeStates.Thrown;
        }
Пример #13
0
 public void ReceiveAxe()
 {
     AxeState = AxeStates.InHand;
     UpdateAxeState();
 }
Пример #14
0
 void SetParent(string parent)
 {
     current_axe_state = parent == "hand" ? AxeStates.in_hand : AxeStates.in_back;
     MoveToParent();
 }