void ValueChanged(bool tf) { if (toggle.isOn) { Debug.Log("Assigning ship " + partType + " to #:" + partNum); ShipCustomization.SetPart(partType, partNum); } }
void Start() { S = this; //Find replaceable parts on this ship or its children currPartsDict = new Dictionary <ShipPart.eShipPartType, Transform>(); ShipPart[] parts = GetComponentsInChildren <ShipPart>(); foreach (var shipPart in parts) { currPartsDict.Add(shipPart.type, shipPart.transform); } }
private void OnDrawGizmos() { if (!Application.isEditor || !Application.isPlaying) { return; } if (checkToSwapPart) { ShipCustomization.SetPart(swapToType, swapToNum); checkToSwapPart = false; } }