public static RopePhysics Instance()
 {
     if (_instance == null)
     {
         _instance = new RopePhysics();
     }
     return(_instance);
 }
Пример #2
0
        void OnEnable()
        {
            _ropePhysics = RopePhysics.Instance();
            _ropePhysics.Add(this);

            _prevPosition = transform.position;
            _axis         = _ropePhysics.axis;
            _accel        = Vector3.zero;
        }
 void OnEnable()
 {
     _physics = RopePhysics.Instance();
     _physics.constraintIterations = constraintIterations;
     _physics.constraintSqrError   = constraintSqrError;
     _physics.damping    = damping;
     _physics.axis       = axis;
     _physics.useGravity = useGravity;
     _timeResidue        = 0f;
     if (Application.isPlaying)
     {
         executeInEditor = false;
     }
 }
Пример #4
0
        void OnEnable()
        {
            _ropePhysics = RopePhysics.Instance();
            _ropePhysics.Add(this);

            _prevPosition = transform.position;
            _axis = _ropePhysics.axis;
            _accel = Vector3.zero;
        }
Пример #5
0
 public static RopePhysics Instance()
 {
     if (_instance == null)
         _instance = new RopePhysics();
     return _instance;
 }
Пример #6
0
 void OnEnable()
 {
     _physics = RopePhysics.Instance();
     _physics.constraintIterations = constraintIterations;
     _physics.constraintSqrError = constraintSqrError;
     _physics.damping = damping;
     _physics.axis = axis;
     _physics.useGravity = useGravity;
     _timeResidue = 0f;
     if (Application.isPlaying)
         executeInEditor = false;
 }