Beispiel #1
0
    private static void ControlHand(
        SpringJoint controlJoint,
        SmoothFloat controlWeight,
        Vector3 targetPosition,
        Rigidbody rigidbody,
        bool doControl,
        Vector3 direction,
        float force
        )
    {
        controlJoint.transform.position = targetPosition;

        controlWeight.Put(doControl ? 1f : 0f);
        controlJoint.spring = Mathf.Lerp(0, force, controlWeight.Value);

        if (controlWeight.Value > freezeHandRotationThreshold)
        {
            rigidbody.MoveRotation(Quaternion.LookRotation(direction) * handCorrection);
            rigidbody.freezeRotation = true;
        }
        else
        {
            rigidbody.freezeRotation = false;
        }
    }
Beispiel #2
0
 public SmoothVector(float time)
 {
     Time = time;
     x    = new SmoothFloat(time);
     y    = new SmoothFloat(time);
     z    = new SmoothFloat(time);
 }
Beispiel #3
0
    void Awake()
    {
        _smoothPercentage          = 0.0f;
        _smoothPercentage.Duration = 0.0f;

        _stripCamera = gameObject.GetComponentInChildren <StripCamera>();
        _input       = InputController.instance;
    }
Beispiel #4
0
 protected virtual void Awake()
 {
     activePlayer    = null;
     smoothYaw       = new SmoothFloat();
     smoothPitch     = new SmoothFloat();
     smoothTransform = gameObject.EnsureComponent <SmoothTransform>();
     syncedObject    = gameObject.EnsureComponent <SyncedObject>();
 }
Beispiel #5
0
    public void Start()
    {
        _eyeOffset          = new SmoothFloat(0);
        _eyeOffset.Ease     = EasingType.Cubic;
        _eyeOffset.Mode     = SmoothingMode.smooth;
        _eyeOffset.Duration = 2.0f;
        _eyeMaterialLeft    = (GameObject.Find(Identifier + "_eye_Left")).renderer.material;
        _eyeMaterialRight   = (GameObject.Find(Identifier + "_eye_Right")).renderer.material;

        _logic = Logic.instance;
        _.Wait(2.0f).Done(Blink);
    }
Beispiel #6
0
 void Awake()
 {
     _volume = 0.0f;
 }
Beispiel #7
0
 public SmoothVector(bool rt)
 {
     x = new SmoothFloat (rt);
     y = new SmoothFloat (rt);
     z = new SmoothFloat (rt);
 }