public void Click()
    {
        //when a player equips a part, it should first remove any part of the same hardpoint from the unactive list.
        foreach (GameObject m in gManager.activePartsList)
        {
            if (m.GetComponent <MechaPartScript>().part.hardPoint == mechaPart.GetComponent <MechaPartScript>().part.hardPoint)
            {
                partToReplace = m;
            }
        }
        gManager.activePartsList.Remove(partToReplace);
        gManager.partsList.Add(partToReplace);
        gManager.activePartsList.Add(mechaPart);
        gManager.partsList.Remove(mechaPart);
        dpScript.RebuildMech();

        if (mechaPart.GetComponent <MechaPartScript>().part.hardPoint == HardPoint.Head)
        {
            suiScript.DisplayHeadsInInventory();
        }
        if (mechaPart.GetComponent <MechaPartScript>().part.hardPoint == HardPoint.Core)
        {
            suiScript.DisplayCoresInInventory();
        }
        if (mechaPart.GetComponent <MechaPartScript>().part.hardPoint == HardPoint.Legs)
        {
            suiScript.DisplayLegsInInventory();
        }
        if (mechaPart.GetComponent <MechaPartScript>().part.hardPoint == HardPoint.RArm)
        {
            suiScript.DisplayRarmsInInventory();
        }
        if (mechaPart.GetComponent <MechaPartScript>().part.hardPoint == HardPoint.LArm)
        {
            suiScript.DisplayLarmsInInventory();
        }
        if (mechaPart.GetComponent <MechaPartScript>().part.hardPoint == HardPoint.Weapon1)
        {
            suiScript.DisplayWeapon1sInInventory();
        }
        if (mechaPart.GetComponent <MechaPartScript>().part.hardPoint == HardPoint.Weapon2)
        {
            suiScript.DisplayWeapon2sInInventory();
        }
    }
 public void Click()
 {
     gManager.activePartsList.Remove(mechaPart);
     gManager.partsList.Add(mechaPart);
     dpScript.RebuildMech();
 }
Beispiel #3
0
 public void OnClick()
 {
     gManager.playerColor = hue;
     dScript.RebuildMech();
 }