void OnTriggerExit(Collider other)
    {
        Caught caught = other.GetComponent <Caught>();

        if (caught)
        {
            caught.Release();
        }
    }
예제 #2
0
 public ProjectileInfo(double _time, GameObject _gameobject, Pair _startposition, Pair _userposition)
 {
     TimeLaunched      = _time;
     Projectile        = _gameobject.GetComponent <Projectile>();
     IsCaught          = Caught.Undetermined;
     IsFinished        = false;
     LastSubmitted     = "";
     StartPosition     = _startposition;
     UserStartPosition = _userposition;
 }
예제 #3
0
 public void ProjectileLanded(double time, GameObject projectile, Caught caught)
 {
     foreach (ProjectileInfo current in Projectiles)
     {
         if (projectile.GetComponent <Projectile>().ID == current.ID)
         {
             current.IsCaught   = caught;
             current.TimeLanded = time;
         }
     }
 }
예제 #4
0
        public bool Tick()
        {
            if (PlayerPos == Layers.Keys.Max())
            {
                return(false);
            }

            PlayerPos++;

            if (Layers.ContainsKey(PlayerPos) && Layers[PlayerPos].ScannerPos == 0)
            {
                Caught.Add(PlayerPos);
            }


            //(wait + pos) % (2 * (height - 1)) == 0

            TickLayers();

            return(true);
        }
예제 #5
0
    void OnTriggerEnter(Collider other)
    {
        if (!other.attachedRigidbody)
        {
            return;
        }
        if (other.attachedRigidbody.isKinematic)
        {
            return;
        }

        Caught caught = other.GetComponent <Caught>();

        if (!caught)
        {
            caught = other.gameObject.AddComponent <Caught>();
            caught.Init(this, springForce, damper, maxDistance, minDistance);
        }
        else if (caught && !caught.enabled)
        {
            caught.Init(this, springForce, damper, maxDistance, minDistance);
        }
    }
예제 #6
0
 public void it_throws_an_invalid_operation_exception()
 {
     Caught.ShouldBeInstanceOfType <InvalidOperationException>();
 }
예제 #7
0
 void OnTriggerEnter(Collider other)
 {
     StartCoroutine(deathSequence());
     Caught?.Invoke(ValueAlongCurve);
 }