Beispiel #1
0
 public IArmState GetNextState(ArmComponent arg_arm)
 {
     if (m_finished)
     {
         arg_arm.m_isActive = false;
         return(new ArmStandByState());
     }
     return(null);
 }
Beispiel #2
0
        public void OnUpdate(ArmComponent arg_arm)
        {
            arg_arm.m_currentLength = arg_arm.m_lengthBuf.Pop();

            if (arg_arm.m_lengthBuf.Count <= 0)
            {
                m_finished = true;
            }
        }
Beispiel #3
0
        private bool IsCollided(ArmComponent arg_arm)
        {
            Vector2 forward = (arg_arm.m_targetPosition - (Vector2)arg_arm.m_transform.position).normalized;

            if (Physics2D.Raycast(arg_arm.GetTopPosition(), forward, m_increase, 1 << LayerMask.NameToLayer("Ground")))
            {
                return(true);
            }
            return(false);
        }
Beispiel #4
0
 public IArmState GetNextState(ArmComponent arg_arm)
 {
     if (m_isCancelled)
     {
         return(new ArmShortenState());
     }
     if (m_isFinished)
     {
         return(new ArmFreezeState());
     }
     return(null);
 }
Beispiel #5
0
        public override void OnGraspedStay(PlayerComponent arg_player)
        {
#if DEVELOP
            Debug.Log("Grasped : Update");
#endif

            ArmComponent arm = arg_player.Arm;

            if (arm.m_lengthBuf.Count > 0)
            {
                arm.m_transform.position = m_transform.position + (m_direction * arm.m_lengthBuf.Peek());
            }
            else
            {
                arm.m_transform.position = m_transform.position;
                arg_player.gameObject.transform.position = arm.m_transform.position = transform.position;
            }
            arg_player.m_rigidbody.velocity = Vector2.zero;
        }
Beispiel #6
0
 public void OnEnter(ArmComponent arg_arm)
 {
     m_finished = false;
 }
Beispiel #7
0
 public void OnExit(ArmComponent arg_arm)
 {
     arg_arm.m_owner.m_inputHandle.m_reach = false;
 }
Beispiel #8
0
 public void OnEnter(ArmComponent arg_arm)
 {
     arg_arm.m_shorten = false;
 }
Beispiel #9
0
 public void OnExit(ArmComponent arg_arm)
 {
 }
Beispiel #10
0
 public void OnUpdate(ArmComponent arg_arm)
 {
 }
Beispiel #11
0
 public void OnExit(ArmComponent arg_arm)
 {
     arg_arm.m_owner.Hand.CallResultArmLengthend(m_isFinished);
 }
Beispiel #12
0
 public void OnEnter(ArmComponent arg_arm)
 {
     m_isFinished  = false;
     m_isCancelled = false;
 }
Beispiel #13
0
 public void OnEnter(ArmComponent arg_arm)
 {
     arg_arm.m_owner.Hand.m_graspingItem.OnGraspedEnter(arg_arm.m_owner);
 }