예제 #1
0
    private void Idle()
    {
        GameObject[] checkObj = IR.CheckState(1);
        if (checkObj != null)
        {
            if (checkObj[0].tag == "Player")
            {
                Player = checkObj[0];
            }
        }

        if (Player != null)
        {
            active = true;
        }

        if (active)
        {
            RigidbodyMovement           RBM = Player.GetComponent <RigidbodyMovement>();
            CharacterControllerMovement CCM = Player.GetComponent <CharacterControllerMovement>();
            if (RBM != null)
            {
                RBM.enabled = false;
                Destroy(RBM.gameObject.GetComponent <Rigidbody>());
            }
            else if (CCM != null)
            {
                CCM.enabled = false;
                CCM.gameObject.GetComponent <CharacterController>().enabled = false;
            }

            Player.transform.position = PlayerSeat.position;
            Player.transform.rotation = PlayerSeat.rotation;
        }
    }
예제 #2
0
    public static void RotationToDirection(RigidbodyMovement movement, Vector2 direction, RangedFloat applicationPeriod, float rotationSpeed = 0.3f)
    {
        //Vector2 destination = Vector2.Lerp(inputHolder.directionInput, direction, trackFactor);

        //movement.atExternalRotation = false;
        //if (applicationPeriod.InRange(animationTime))
        //movement.ApplyExternalRotation(destination, rotationSpeed);
    }
예제 #3
0
    private void Awake()
    {
        #region Getting

        rbMove      = GetComponent <RigidbodyMovement>();
        animManager = GetComponent <AnimationManager>();
        groundCheck = transform.Find("Ground Check");

        #endregion
    }
예제 #4
0
    private void Start()
    {
        rigidbody   = GetComponent <Rigidbody2D>();
        movement    = GetComponent <RigidbodyMovement>();
        inputHolder = GetComponent <InputHolder>();
        animator    = GetComponent <Animator>();
        health      = GetComponent <HealthController>();

        if (weapon)
        {
            weapon.InitCharacterStateController(this);
        }
    }
 private void Start()
 {
     movement = GetComponent <RigidbodyMovement>();
 }