Ejemplo n.º 1
0
    /*
     * Generates new colours for robot parts
     */
    private void GenerateRobot()
    {
        parts        = new Dictionary <string, string>();
        part_success = new Dictionary <string, bool>();

        RobotPartBase r_b = new RobotPartBase();

        int length = r_b.colours.Count;

        AssignPart("Head", r_b.colours, ref length);
        AssignPart("Torso", r_b.colours, ref length);

        //Reset these variables because legs have different variables from torso/head
        r_b    = new RobotPartBase("Sprites/RobotReconstruction/Legs");
        length = r_b.colours.Count;

        AssignPart("Legs", r_b.colours, ref length);

        //Used to determine if we have the part
        part_success.Add("Head", false);
        part_success.Add("Torso", false);
        part_success.Add("Legs", false);

        FindObjectOfType <RobotGameUI>().UpdateUI();
    }
Ejemplo n.º 2
0
 public void SwapPart(RobotPartBase newPart)
 {
     for (int i = 0; i < robotParts.Count; i++)
     {
         if (robotParts[i].partType == newPart.partType)
         {
             robotParts[i] = newPart;
             robotParts[i].Construct(this, robotMaker.SnapPointOfPartType(newPart.partType));
         }
     }
 }
Ejemplo n.º 3
0
 public void SwapPart(RobotPartBase newPart)
 {
     robotToBuild.SwapPart(newPart);
 }