//==
    //1.Equals(1) = true

    //this method exists in every object in C sharp


    public override bool Equals(System.Object obj)
    {
        if (obj == null)
            return false;
        enemyPositionRecord p = obj as enemyPositionRecord;
        if ((System.Object)p == null)
            return false;
        return position == p.position;
    }
    public bool Equals(enemyPositionRecord o)
    {
        if (o == null)
            return false;


        //the distance between any food spawned
        return Vector3.Distance(this.position, o.position) < 5f;
    }
Exemple #3
0
    //==
    //1.Equals(1) = true

    //this method exists in every object in C sharp


    public override bool Equals(System.Object obj)
    {
        if (obj == null)
        {
            return(false);
        }
        enemyPositionRecord p = obj as enemyPositionRecord;

        if ((System.Object)p == null)
        {
            return(false);
        }
        return(position == p.position);
    }