예제 #1
0
    //checks if the found mate is available to mate
    bool confirmMate(GameObject mateHead)
    {
        Reproduction materep = mateHead.GetComponent <Reproduction> ();

        if (materep != null && !materep.ismating)
        {
            ismating = true;             //lock self first

            //set mate and egg to that of the mate
            if (materep.setMate(this.transform.parent.gameObject))
            {
                mate = mateHead.transform.parent.gameObject;
                egg  = materep.getEgg();
                return(true);
            }
        }
        return(false);
    }