Example #1
0
 public void OccupiedSquare(BPartGenericScript incomingBodyPartReference)            //used by playarea to turn on and off if the enemy occupies the space
 {
     bodyPartReference = incomingBodyPartReference;
     trueTarget        = occupiedTargetedSprite;
     trueUntarget      = occupiedUntargetedSprite;
     activeSquareState.setOccupiedState(true);
     spriteRenderer.sprite = occupiedUntargetedSprite;
 }
Example #2
0
    public void setBodyPart(BPartGenericScript incomingBodyPart)
    {
        //Debug.Log (incomingBodyPart.getType());
        hasAnyBodyParts = true;
        listOfAllParts.Add(incomingBodyPart);
        switch (incomingBodyPart.getType())
        {
        case ("Arm"):
            if (incomingBodyPart.getSide())
            {
                leftArm = incomingBodyPart;
                //Debug.Log("left arm import check: " +leftArm.getName ());
                break;
            }
            else
            {
                rightArm = incomingBodyPart;
                //Debug.Log("left arm import check: " +leftArm.getName ());
                break;
            }

        case ("Head"):
            head = incomingBodyPart;
            //Debug.Log("left arm import check: " +leftArm.getName ());
            break;

        case ("Leg"):
            if (incomingBodyPart.getSide())
            {
                leftLeg = incomingBodyPart;
                break;
            }
            else
            {
                rightLeg = incomingBodyPart;
                break;
            }

        case ("Shoulder"):
            if (incomingBodyPart.getSide())
            {
                leftShoulder = incomingBodyPart;
                break;
            }
            else
            {
                rightShoulder = incomingBodyPart;
                break;
            }

        case ("Torso"):
            torso = incomingBodyPart;
            break;
        }
    }
Example #3
0
 public void resetBodyToZero()
 {
     leftArm       = null;
     rightArm      = null;
     head          = null;
     leftLeg       = null;
     rightLeg      = null;
     leftShoulder  = null;
     rightShoulder = null;
     torso         = null;
     listOfAllParts.Clear();
 }
Example #4
0
    public BPartGenericScript makeBodyPart(string nameOfpart, string leftOrRight)
    {
//		Debug.Log ("check: " + nameOfpart + " " + leftOrRight);
        //Debug.Log("name: "+ nameOfpart);
        //Debug.Log("leftor right: "+ leftOrRight);
        //BodyPartDataHolder partData = new BodyPartDataHolder();
        partData = bPartXMLReader.getBodyData(nameOfpart);
        BPartGenericScript instaBodypart = Instantiate(bodyPartObject, Vector3.zero, bodyPartObject.GetComponent <Transform>().rotation);

        //Debug.Log ("body data check: "+bPartXMLReader.getBodyData (nameOfpart).name);
        instaBodypart.CreateNewPart(partData, leftOrRight);
        //Debug.Log ("instantiated after: "+instaBodypart.getName());
        return(instaBodypart);
    }