コード例 #1
0
 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);
        }
    }
コード例 #3
0
    private void OnDrawGizmos()
    {
        if (!Application.isEditor || !Application.isPlaying)
        {
            return;
        }

        if (checkToSwapPart)
        {
            ShipCustomization.SetPart(swapToType, swapToNum);
            checkToSwapPart = false;
        }
    }