Exemple #1
0
    void Update()
    {
        Pattern.Invoke(controller, transform);


        /*
         *      if (controller.isGrounded) {
         *
         *              moveDirection.Set(MoveX.Value, MoveY.Value, MoveZ.Value);
         *
         *              //moveDirection.Set(Input.GetAxis("Horizontal"), 0, Input.GetAxis(("Vertical")));
         *
         *              //moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
         *              rotDirection.Set( MoveX.Value, MoveY.Value, MoveZ.Value);
         *              rotDirection.Set(Rotx.Value, Roty.Value, Rotz.Value);
         *              transform.Rotate(rotDirection);
         *
         *              moveDirection = transform.TransformDirection(moveDirection);
         *              //moveDirection *= speed;
         *              if (Input.GetButton("Jump"))
         *                      moveDirection.y = jumpSpeed.Value;
         *
         *      }
         *      moveDirection.y -= gravity.Value * Time.deltaTime;
         *      controller.Move(moveDirection * Time.deltaTime);
         */
    }
 private void FixedUpdate()
 {
     if (enabled)
     {
         //_current = player.Current;
         _current.Invoke(_controller, transform);
     }
 }
 void Update()
 {
     Pattern.Invoke(controller, transform);
     if (Input.GetButtonDown("Fire1") && ammoAmount.value > 0)
     {
         Fire();
     }
 }
Exemple #4
0
    void Update()

    {
        Pattern.Invoke(controller, transform);
        if (transform.position.z != 0)
        {
            Vector3 pos = transform.position;
            pos.z = 0;
            transform.position = pos;
        }
    }
 void Update()
 {
     if (controller.isGrounded)
     {
         //Car.enabled = !Car.enabled;
         Car.Invoke(controller, transform);
     }
     else
     {
         Airplane.Invoke(controller, transform);
     }
 }
    private IEnumerator TurnAround()
    {
        ReachedDestination.value = false;
        enabled        = false;
        angle          = 180;
        _destination   = target.transform.position;
        _destination.y = transform.position.y;
        _rotation      = target.transform.rotation;
        _direction     = _destination - transform.position;
        angle          = Vector3.Angle(_direction, transform.forward);
        Automatic_Forward.MoveZ.value = SpeedFloat;
        while (angle >= 10)
        {
            _direction = _destination - transform.position;
            angle      = Vector3.Angle(_direction, transform.forward);
            Debug.Log(angle);
            Automatic_Forward.RotY.value = RotationFloat;
            Automatic_Forward.Invoke(_controller, transform);
            yield return(new WaitForFixedUpdate());
        }
        while (!ReachedDestination.value)
        {
            Automatic_Forward.RotY.value = 0;
            Automatic_Forward.Invoke(_controller, transform);
            yield return(new WaitForFixedUpdate());
        }
        while (transform.rotation.y > _rotation.y)
        {
            _direction = _destination - transform.position;
            angle      = Vector3.Angle(_direction, -transform.forward);

            Automatic_Forward.MoveZ.value = 0;
            Automatic_Forward.RotY.value  = RotationFloat;
            Automatic_Forward.Invoke(_controller, transform);
            yield return(new WaitForFixedUpdate());
        }
        print("Done");
        Reach_Destination.Invoke();
        enabled = true;
    }
 void Update()
 {
     Pattern.Invoke(controller, transform);
 }
Exemple #8
0
    void Update()

    {
        MovePatterns.Invoke(controller, transform);
    }
 void Update()
 {
     Current.Invoke(controller, transform);
 }