Example #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (StartingSide != null ? StartingSide.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EndingSide != null ? EndingSide.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)TorchLocation;
         return(hashCode);
     }
 }
    //public Reward Reward;

    public void InIComet(float disatnce, float velocity)
    {
        Disatnce = disatnce;
        Velocity = velocity;
        int randomStartingSide = Random.Range(0, 4);

        StartingSide = (StartingSide)randomStartingSide;
        int randomStartingDirection = Random.Range(0, 3);

        StartingDirection = (StartingDirection)randomStartingDirection;

        GetStartingPosition();

        this.transform.position = position;

        Rigidbody rigidbody = gameObject.GetComponent <Rigidbody>();

        rigidbody.AddForce(speed);
    }