Example #1
1
    protected int _timeToDie = 0;  // Timer after _timeToLive goes negative before deactivation.

    public override void Init(IInteractionBehaviour interactionBehaviour, ActivityManager manager) {
      _interactionBehaviour = interactionBehaviour;
      _manager = manager;
      Revive();

      _rigidbody = GetComponent<Rigidbody>();
    }
Example #2
0
        public override void Init(IInteractionBehaviour interactionBehaviour, ActivityManager manager)
        {
            base.Init(interactionBehaviour, manager);

            bool wasSleeping = _rigidbody.IsSleeping();

            //We need to do this in order to force Unity to reconsider collision callbacks for this object
            //Otherwise scripts added in the middle of a collision never recieve the Stay callbacks.
            Collider singleCollider = GetComponentInChildren <Collider>();

            if (singleCollider != null)
            {
                Physics.IgnoreCollision(singleCollider, singleCollider, true);
                Physics.IgnoreCollision(singleCollider, singleCollider, false);
            }

            if (wasSleeping)
            {
                _rigidbody.Sleep();
            }
        }
Example #3
0
    public override void Init(IInteractionBehaviour interactionBehaviour, ActivityManager manager) {
      base.Init(interactionBehaviour, manager);

      bool wasSleeping = _rigidbody.IsSleeping();

      //We need to do this in order to force Unity to reconsider collision callbacks for this object
      //Otherwise scripts added in the middle of a collision never recieve the Stay callbacks.
      Collider singleCollider = GetComponentInChildren<Collider>();
      if (singleCollider != null) {
        Physics.IgnoreCollision(singleCollider, singleCollider, true);
        Physics.IgnoreCollision(singleCollider, singleCollider, false);
      }

      if (wasSleeping) {
        _rigidbody.Sleep();
      }
    }
Example #4
0
    public static int hysteresisTimeout = 5;                       //In fixed frames

    public abstract void Init(IInteractionBehaviour interactionBehaviour, ActivityManager manager);
Example #5
0
        public static int hysteresisTimeout   = 5;                 //In fixed frames

        public abstract void Init(IInteractionBehaviour interactionBehaviour, ActivityManager manager);