Ejemplo n.º 1
0
    public GameObject changePart( GameObject oldGameObject, Part newPart, GameObject newRobot )
    {
        Part clonedNewPart;

        GameObject newGameObject = procuraObjetoEmUmaPrefab( newPart.PartType, getGameObjectByName( newPart.PrefabName ) );

        newGameObject = changePart( oldGameObject, newGameObject, newRobot );

        newGameObject.name = newGameObject.name.Replace("(Clone)", "");

        clonedNewPart = newGameObject.GetComponent<Part>();

        newPart.copyUniqueAttributes( clonedNewPart );

        return newGameObject;
    }