Пример #1
0
        public override void Movement()
        {
            var dir = (ActivePlayer.Trans.position - Trans.position).normalized;

            dir = dir.normalized * MovementSpeed * Time.deltaTime;
            Rigid.MovePosition(Trans.position + dir);
        }
Пример #2
0
 public override void Progress()
 {
     Rigid.MovePosition(Vector3.MoveTowards(transform.position, transform.position + speed * Direction, inversedMoveTime * Time.deltaTime));
     lifeSpan--;
     if (lifeSpan < 0 || (k514SystemManager.InteractMgr.GetPlayerVector().z - transform.position.z) > 2f)
     {
         Interactive_Destroy();
     }
 }
Пример #3
0
    private void FixedUpdate()
    {
        if (_ragdoll.ReferenceSystem != null)
        {
            Rigid.MovePosition(_ragdoll.ReferenceSystem.ProjectOnPlane(Rigid.position));
        }

        //if (Rigid.velocity.sqrMagnitude < Ragdoll.GroundParams.StopVelocityMaxSqr)
        //	IsGrounded = (_groundTimer -= Time.fixedDeltaTime) < 0f;
        //else
        //	_groundTimer = Ragdoll.GroundParams.Timeout;
    }
Пример #4
0
    protected override void Move()
    {
        Vector2 dir = Value.JoyTouch;

        MoveDirc = dir;
        float   TileSpeed = OnTile.TileSpeed;
        Vector2 Movedir   = (dir * TileSpeed * Speed * Time.deltaTime);

        //transform.position = new Vector2(transform.position.x + dir.x, transform.position.y + dir.y);
        Rigid.MovePosition(Rigid.position + Movedir);
        Render.sortingOrder = -(int)Rigid.position.y;
    }
Пример #5
0
        public override void Movement()
        {
            var x     = CanMoveX ? Input.GetAxisRaw("Horizontal") : 0;
            var z     = CanMoveZ ? Input.GetAxisRaw("Vertical") : 0;
            var input = new Vector3(x, 0, z);

            input = input.normalized * MovementSpeed * Time.deltaTime;
            Rigid.MovePosition(Trans.position + input);

            if (CanJump && Input.GetKeyDown(KeyCode.Space) && FloorPlane.GetDistanceToPoint(Trans.position) < 0.51f)
            {
                Rigid.AddForce(Vector3.up * 6, ForceMode.Impulse);
            }
        }